Welcome to the forum.
Just a guess, but are you loading the the file from a file or via a web server? It won't work if you are loading it from a file, i.e. file:///C:/sample/index.html. If so, you need to use a local web server, use an IDE with one built in, use a real web server, etc. Then load the file via http://localhost/sample/index.html for example.