Yo my coding ninja fledglings, in this HTML lesson for beginners we’ll dive into adding some JavaScript into our HTML web page. JavaScript controls the interactivity of our web pages and can be added in a variety of ways to HTML.
We add JavaScript to HTML by using the script tag in the head of body, by referencing an external script file, or by adding some in-line scripting onto tags themselves.
For more front-end development courses & to black-belt your coding skills, head over to https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg or http://thenetninja.co.uk
Comment with any questions and don’t forget to subscribe!
Original source
9 responses to “HTML Tutorial for Beginners 16 – Adding JavaScript to HTML”
Make sure when you type the code, type "onclick" not "oneclick" like i did, took me forever to figure out that was the problem lol
do I need to upload a programme for the script alert to pop up
what if i want to pass a value the js script??
Hi Ninja! Placing the script tag either in the head tag or body tag works the same way for me. The page is rendered by the time the alert pops up in both cases. Can you please explain why?
I am having problems, no matter which way i try to add javascript it doesn't work!
Hi there, may i know why i cant add another link like u does in 7:36 ? It says that my file is not found. Im using notepad to creates html and im still new to this :).
Finally a helpful script tutorial, THANK YOU
Can I use a javascript testfor command to show an image?
So when someone give a true answer, a happy face appears and if he gives a false answer a sad face appear?
Hey! Do you know where we can upload JavaScript files in order to get the source/link?