25.33. The Text Object

The Text object corresponds to HTML elements created through <INPUT TYPE="TEXT" ...>. Text objects are normally accessed through the elements array of the enclosing Form object or, if both it and the form are named, through document.formName.textfieldName.

Properties

defaultValue This read-only property is the initial value as given in the VALUE attribute.

form This read-only property is the Form object containing the password field.

name This read-only property is the value of the NAME attribute.

type This read-only property contains the value text.

value This property gives the current text contained in the textfield. It is read/write.

Methods

blur() This method removes the keyboard focus from the textfield.

focus() This method ...

Get Core Web Programming, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.