Moved the js code to the html file.