Another Simple JavaScript Example

These examples run when the page is loaded, writing into the document. They appear in the body of the page. The last one uses a function. It appears in the head
Date example:


Generate Random Numbers:
Raw Random Number Between 0 and 1:
Between 1 and 10:

A Sample Form With A Button:
// Buttons can only occur within forms Here's a Button that causes an alert. Note: Its name is submit, NOT its type


Remember to look at the source for this page!