HTML and CSS Reference
The window portion of the code identifies the browser
object resizeTo() is an
statements must end with a semicolon.
object to be affected, and
part of the web page when the user hovers over another part of the page. Another common use of
a precise page element — such as a text field in a specific form — and analyze, modify, or delete its
content. The DOM is made up of a series of objects including window , document , history , form ,
down through the various objects.
For example, say you have a text form control with a name of fullName that is contained in a form
named myForm . To find the current value of that field — what's in the text box, in other words —
var theEntry = window.document.myForm.fullName.value;
can get or set the current value of a page element. The code var is short for variable and, unlike in
many other computer languages, you don't need to specify whether the variable is text, number, or
some other type.
variables and functions exactly. In other words, theEntry is not the same as
TheEntry or theentry .
Now that you have captured what was entered in the fullName text field, you can use that in
alert(“Thanks for entering, “ + theEntry);
The plus sign is used here to bring together — or concatenate — the static text string ( “Thanks for
entering, “ ) and the variable, theEntry . When incorporated into a page that I had visited, the
resulting message box might look like the one in Figure 21-1.