Platform Support
| IE | Mozilla | Netscape | Opera | Safari | Chrome | 4.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ | no |
|---|
Constructors
| Constructor | Action | IE | Mozilla | Netscape | Opera | Safari | Chrome | ||
|---|---|---|---|---|---|---|---|---|---|
|
HTMLInputElement Constructor() : HTMLInputElement
Input element on an HTML Form
|
Show Details | 4.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ | no | ||
HTMLInputElement() : HTMLInputElementInput element on an HTML Form Returns
|
|||||||||
Properties
| Property | Action | IE | Mozilla | Netscape | Opera | Safari | Chrome |
|---|---|---|---|---|---|---|---|
|
accept
: String
MIME Types accepted in a FileUpload element on the Form.
|
Show Details | 5.0+ | no | no | no | no | no |
|
|||||||
|
accessKey
: String
Hot-key shortcut for the element.
|
Show Details | 4.0+ | no | no | no | no | no |
|
|||||||
|
align
: String
Defines the alignment of the element.
|
Show Details | 4.0+ | no | no | no | no | no |
|
|||||||
|
alt
: String
Specifies alternative text to display if the element cannot be displayed as expected.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
Specifies whether form autocompletion, which automatically completes the fields on a form after the user has typed enough
letters, is on or off.
|
No Details | 5.0+ | no | no | no | no | no |
|
|
|||||||
|
checked
: Boolean
Specifies whether or not the element is checked.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
Field from a data source that is bound to the element.
|
No Details | 4.0+ | no | no | no | no | no |
|
|
|||||||
|
Specifies how to format the element data.
|
No Details | 4.0+ | no | no | no | no | no |
|
|
|||||||
|
Data source that is bound to the element.
|
No Details | 4.0+ | no | no | no | no | no |
|
|
|||||||
|
defaultChecked
: Boolean
If true, specifies that the element should be checked by default.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
defaultValue
: String
Initial value for the element.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
disabled
: Boolean
If true, indicates that the element is disabled.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
form
: HTMLFormElement
The form that contains this element.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
Height (in pixels) of the element.
|
No Details | 4.0+ | 1.0+ | 4.0+ | 7.0+ | 1.0+ | no |
|
|
|||||||
|
maxLength
: Number
Maximum number of characters that a user may type into the element.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
name
: String
Unique name of the element.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
readOnly
: Boolean
If true, indicates that the user cannot enter text into or change the element.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
size
: String
Number of characters that the field visibly holds.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
src
: String
URL for an image for the element.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
If true, indicates that the element is currently selected.
|
No Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
|
|
|||||||
|
tabIndex
: Number
Position of the element in the tabbing order for the document.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
type
: String
Type of input element.
|
Show Details | 4.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
useMap
: String
Specifies a URL to use for an image map or object map.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
value
: String
Value for the element that is sent to the server when the form is submitted.
|
Show Details | 4.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
Vcard name from the profile of the user.
|
No Details | 4.0+ | no | no | no | no | no |
|
|
|||||||
|
Width (in pixels) of the element.
|
No Details | 4.0+ | 1.0+ | 4.0+ | 7.0+ | 1.0+ | no |
|
|
|||||||
Functions
| Method | Action | IE | Mozilla | Netscape | Opera | Safari | Chrome | |||
|---|---|---|---|---|---|---|---|---|---|---|
|
blur() : void
Removes focus from the element.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no | |||
|
Returns
|
||||||||||
|
click() : void
For clickable elements, simulates a mouse click on the element.
|
Show Details | 4.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no | |||
|
Returns
|
||||||||||
|
createTextRange() : textRange
Creates a new textRange object.
|
Show Details | 4.0+ | no | no | no | no | no | |||
|
Returns
|
||||||||||
|
focus() : void
Places focus on the element.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no | |||
|
Returns
|
||||||||||
|
handleEvent(Event event) :
void
Process the instance of the event.
|
Show Details | no | no | 4.0+ | no | no | no | |||
|
Parameters
|
||||||||||
|
select() : void
For elements containing text, selects the element text.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no | |||
|
Returns
|
||||||||||
References
HTMLFormElement|HTMLOptionElement|HTMLSelectElement|HTMLTextAreaElement|Input|Button|Checkbox|FileUpload|Hidden|Password|Radio|Reset|Submit|Text
Availability
HTML DOM Level 1|HTML DOM Level 2|W3C