Based on the error message you posted, it sounds like you tried to run the .js file, instead of opening the html file in the browser.