Browser/User Agent Support
| IE | Mozilla | Netscape | Opera | Safari | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|---|
Constructors
| Constructor | IE | Mozilla | Netscape | Opera | Safari |
|---|---|---|---|---|---|
Creates a new instance of an Input object. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
Properties
| Property | IE | Mozilla | Netscape | Opera | Safari |
|---|---|---|---|---|---|
Name of the element. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
Event handler for when focus is moved off the element. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
Event handler for when a user changes makes a change element and moves focus off the element. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
Event handler for when a user clicks on the element. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
Event handler for when a user gives focus to the element. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
Type of form element the input element is. | 3.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ |
Value of the element when the form is submitted. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
If the element is a radio button or checkbox, specifies whether or not the element is checked. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
If the element is a radio button or checkbox, specifies whether or not the element is checked by default. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
Specifies the default value for the element text. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
Reference to the form that contains the element. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
Number of options in the options array for the element. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
If the element is a Select list, specifies the list of options (as an array) for the element. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
If the element is a Select list, specifies the index of the selected option in the options array. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
Methods
| Method | IE | Mozilla | Netscape | Opera | Safari |
|---|---|---|---|---|---|
Removes focus from the element. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
Simulates a mouse click on the element. Does not invoke the onClick event handler. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
Gives focus to the element. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
Selects the text of the element, if applicable. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
References
Button | Checkbox | FileUpload | Form | Hidden | Password | Radio | Reset | Select | Submit | Text | Textarea | HTMLInputElement
Availability
JavaScript 1.0 | enhanced in JavaScript 1.1 | HTML DOM Level 1 | W3C
Constructor Detail
Property Detail
String name
Name of the element.
- Availability
JavaScript 1.0 | W3C
static Function onblur
Event handler for when focus is moved off the element.
- See Also
- Availability
JavaScript 1.0
static Function onchange
Event handler for when a user changes makes a change element and moves focus off the element.
- See Also
HTMLElement.onkeypress | Event | EventListener | EventTarget
- Availability
JavaScript 1.0
static Function onclick
Event handler for when a user clicks on the element.
- See Also
- Availability
JavaScript 1.0 | enhanced in JavaScript 1.1
static Function onfocus
Event handler for when a user gives focus to the element.
- See Also
- Availability
JavaScript 1.0
String type
Type of form element the input element is.
- Availability
JavaScript 1.1 | W3C
String value
Value of the element when the form is submitted.
- Availability
Netscape 2 | buggy in Internet Explorer 3 | W3C
Boolean checked
If the element is a radio button or checkbox, specifies whether or not the element is checked.
- Availability
W3C
Boolean defaultChecked
If the element is a radio button or checkbox, specifies whether or not the element is checked by default.
- Availability
W3C
String defaultValue
Specifies the default value for the element text.
- Availability
W3C
String form
Reference to the form that contains the element.
- Availability
W3C
Number length
Number of options in the options array for the element.
Array options
If the element is a Select list, specifies the list of options (as an array) for the element.
String selectedIndex
If the element is a Select list, specifies the index of the selected option in the options array.
Method Detail
blur() : Object
Removes focus from the element.
- Availability
JavaScript 1.0 | W3C
click() : Object
Simulates a mouse click on the element. Does not invoke the onClick event handler.
- Availability
JavaScript 1.0 | W3C
focus() : Object
Gives focus to the element.
- Availability
JavaScript 1.0 | W3C
select() : Object
Selects the text of the element, if applicable.
- Availability
JavaScript 1.0 | W3C
