In order to run the code, you will need a simple server, say a Python SimpleHTTPServer. In order to see the code on the browser, first start the server. On Mac, use the following command:
py -m SimpleHTTPServer
On Windows, use the following command in the folder that you have the code :
py -m http.server
and then you can simply go to localhost:8080. It will run index.html for you in that folder.