how to use localhost
Step 1:
save your code
Step 2:
go to terminal and type in:
python -m SimpleHTTPServer
//this works with every coding language (I think)
it will say something and then port 8000 or port 3000
Step 3:
go to your browser and type in localhost://the port number you got
then choose which file you want to view
and that SHOULD work