Hey all. In this JavaScript lesson I’ll show you exactly where to put your JavaScript code. The code can essentially be placed anywhere on your HTML document, but good practise dictates that
you place it near the bottom of your code, and in an external file if it’s global or large.


========== JavaScript for Beginners Playlist ==========

========== CSS for Beginners Playlist ==========

========== HTML for Beginners Playlist ==========

========== The Net Ninja ============

For more front-end development tutorials & to black-belt your coding skills, head over to – or

========== Social Links ==========

Twitter – @TheNetNinja –


  1. Yo Net Ninja got a crucial question to ask before i invest time. I'm probably just a moron but who the heck cares lol. When you say JS for beginners in the tutorial series does that mean there will be JS concepts covered ranging from introductory to advanced, but just targeted at an audience perhaps not familiar with programming? Or is this a series that's beginner level in the traditional sense, as in an intended prerequisite to intermediate and advanced JS courses?

  2. The alert is printing out before the site actually loads, I tested it out with opening the site again in a new tab so the cash does not have the site loaded already, you should test this out to and correct it in the video.

  3. I used "thenewboston" playlist first, so I know this. Guys, you CAN put your JS in the head OR in the body. However, it's usually better to put it in the bottom of the body so it all loads after the content since JS sometimes means intricate graphics/animation that go on the page and in such a case you want the framework to lay out first (the HTML). If you have a teacher who is going to test you, you go with what they say as long as they are your teacher because well, teachers mark off for stuff like that.

  4. i was watching another tutorial of JavaScript and there, they say you should put your script in the head section.
    which one should I do, which one is better so I won't have any problem with my codes in the future.
    I'm really looking forward to an answer..

  5. Although, I suppose, that if someone is creating a page that should only be accessed by someone of a certain age, then it's important to have the JS alert before the site content as to prevent the person of false/under age from seeing any content before agreeing to the age verification? I guess it depends but I actually understand this. I always prefer to have my JS external, just in case it gets big.

  6. Thank you for these videos! I'm taking a web development class now (university level) and the prof. isn't very good! Now I'm not so lost, after watching your videos! thanks!


Please enter your comment!
Please enter your name here