JavaScript code in the document of one frame can clear another frame


JavaScript code in the document of one frame can clear another frame and write new HTML or even more JavaScript code into another frame.
Before JavaScript, it was enormously complicated to create, on the fly, a new page tailored to the user’s wishes. Now you can do it yourself.

You define frames within a frame document


You define frames within a frame document, or layout document. A typical Web page is made up of an HTML element that contains a HEAD element and a BODY element.
A frame document is usually made up of an HTML element that contains a HEAD element and a FRAMESET element.

FRAME elements are contained within FRAMESET elements


FRAME elements are contained within FRAMESET elements, and FRAMESET elements can also contain other FRAMESET elements, allowing you to divide and subdivide the browser window.
Be careful with this capability, however: You can easily subdivide the browser window to the point that nothing of value is visible.

You can write a JavaScript code


You can write a JavaScript code that can rewrite the contents of a frame in response to the user’s actions.
You can’t modify a frame’s contents, but you can rewrite the frame contents from scratch.

JavaScript recognizes several events


JavaScript recognizes several events that a user can cause within a document.
You can create JavaScript code that reacts to those events, providing interaction with the user.

Within a FORM element, there are SELECT, INPUT, and TEXTAREA elements


Within a FORM element, there are SELECT, INPUT, and TEXTAREA elements, which act as input fields. The user can typically move the cursor from one input field to another by using the Tab key or by clicking the pointing device in an input field.
When the user moves the cursor from one field to another


When the user moves the cursor from one field to another the destination field is said to have acquired focus; the user can now modify that field’s contents.

Within the FORM element, another kind of event the submit event, occurs


Within the FORM element, another kind of event, the submit event, occurs when the user clicks on a submit button. Before there was JavaScript, clicking on the submit button sent the form data to a CGI process on a remote server.
The CGI process would then process the data and send back a new page of data. With JavaScript, you can write an event handler for the submit event.

Within the submit event handler, you can do whatever you like


Within the submit event handler, you can do whatever you like. Most of the input field contents are accessible to your JavaScript code.
You can modify the data and you can decide not to send it out at all. You can create a document and display it in another frame or window. And you can still send it to a CGI process.

In addition to form and field event handlers


In addition to form and field event handlers, you can write event handlers to be executed when the pointing device moves over certain element; such an event is called a mouseover event.
You can also define event handlers that are executed when the document is loaded and when the document is exited.

Through the use of a feature called a cookie


Through the use of a feature called a cookie, documents can share information with each other.
Cookies are small data objects that reside on the user’s machine. You can write JavaScript code to create, modify, and delete cookies.