Basic JavaScript Examples

Example #1

The following date is written using JavaScript code; based on the file last modified date.

Monday, October 11, 2021

Example #2

Click on the following paragraph to change the background color.

This is an important paragraph.

Example #3

Click on each "Display" button to show the hidden paragraphs.

Example #4

Click on the "Modify" button to alter the URL used in the following link.

Google

The URL for this link is https://www.google.com/

Example #5

The following link will open a pop-up window.

Pop-up window

Back