Javascript Lessons

01. JAVASCRIPT FUNCTIONS AND EVENTS

A JavaScript function is a block of JavaScript code, that can be executed when "called" for. A function can be called when an event occurs, like when the user clicks a button. Scripts can be placed in the ❮body❯ or in the ❮head❯ selection of an HTML page, or in both. It can also be in an external style sheet. There are different ways for JavaScript to "display", this is a review:

02. GETELEMENTBYID

One of the many JavaScript HTML methods is getElementById().

Javascript can change HTML content.


03. BUTTONS TO DISPLAY CONTENT

The document will get the date and time.


04. JAVASCRIPT CAN CHANGE HTML ATTRIBUTE VALUES

In this case JavaScript changes the value of the source attribute of an image.