Welcome to Jack's tutorial on basic JavaScript!

Remember to view the page source while looking through this tutorial!


The below button runs a simple function that shows the date

Date/Time will appear here


The below buttons change the colour of the above panel






The below buttons hide and show above panel



As you can see, JS is useful for changing the content and attributes of any page element



The above functions are stored on this page in script tags, but JavaScript can also be stored on separate files using the src attribute in a script tag

JS can do math, using variables:




JS can mix types:

Result will appear here


JS can have objects:

Result will appear here


JS can handle many events: Click here to see full list