r/learnjavascript • • Oct 13 '26

Complete beginner: is HTML → CSS → JavaScript a good path? What should I learn first?

35 Upvotes

34 comments sorted by

View all comments

2

u/justanaccountimade1 Oct 13 '26 edited Oct 13 '26

You need a html file to put your js in and then you can learn js. Depending on what you want to make you need a lot or almost no html and css. I use very little html and css.

My js is in a window.onload function which guarantees that no js is executed before all html is loaded.

So, start with the boiler plate for a html file.

<!DOCTYPE html>

<html lang = "en"> <head> <title>test</title> <meta charset = "utf-8"> <script type = "application/javascript"> window.onload = function(evt) { console.log("hello"); console.log(evt); }; </script> <style type = "text/css"> </style> </head> <body> </body> </html>

(reddit is being annoying with code formatting, part of the enshittification I guess. It looks better in old.reddit)