Moved js from index.html to main.js