Ok first of all, that's a Node.js repl, and Node.js is not user friendly. Secondly, lol why is there CSS in the index.js!?!? And lastly, create an HTML repl to code the web kind of JS, not just a Node.js repl.
Here are some tutorials:
Also you might want to learn HTML too!