- JavaScript is often the main programming language used on websites
- JavaScript is client-side (user's browsers see and execute the code)
- It is used to program the behaviour of web pages
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