Input : HTMLElement
Return to: HTML DOM Level 0 index

Input element on an HTML form.

Platform Support

IE Mozilla Netscape Opera Chrome Safari
3.0+ 1.0+ 2.0+ 7.0+ 5.0+ 1.0+

Constructors

Constructor Action IE Mozilla Netscape Opera Chrome Safari
Creates a new instance of an Input object.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 5.0+ 1.0+

Input() : Input

Creates a new instance of an Input object.

Returns
Input

Visibility
internal

Properties

Property Action IE Mozilla Netscape Opera Chrome Safari
name : String
Name of the element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 5.0+ 1.0+
Availability

JavaScript 1.0|W3C

onblur : Function
Event handler for when focus is moved off the element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 5.0+ 1.0+
See Also

Window.onblur|Event|EventListener|EventTarget

Availability

JavaScript 1.0

onchange : Function
Event handler for when a user changes makes a change element and moves focus off the element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 5.0+ 1.0+
See Also

HTMLElement.onkeypress|Event|EventListener|EventTarget

Availability

JavaScript 1.0

onclick : Function
Event handler for when a user clicks on the element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 5.0+ 1.0+
See Also

Link.onclick|EventListener|EventTarget|MouseEvent

Availability

JavaScript 1.0|enhanced in JavaScript 1.1

onfocus : Function
Event handler for when a user gives focus to the element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 5.0+ 1.0+
See Also

Window.onfocus|Event|EventListener|EventTarget

Availability

JavaScript 1.0

type : String
Type of form element the input element is.
Show Details 3.0+ 1.0+ 3.0+ 7.0+ 5.0+ 1.0+
Availability

JavaScript 1.1|W3C

value : String
Value of the element when the form is submitted.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 5.0+ 1.0+
Availability

Netscape 2|buggy in Internet Explorer 3|W3C

checked : Boolean
If the element is a radio button or checkbox, specifies whether or not the element is checked.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 5.0+ 1.0+
Availability

W3C

defaultChecked : Boolean
If the element is a radio button or checkbox, specifies whether or not the element is checked by default.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 5.0+ 1.0+
Availability

W3C

defaultValue : String
Specifies the default value for the element text.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 5.0+ 1.0+
Availability

W3C

form : String
Reference to the form that contains the element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 5.0+ 1.0+
Availability

W3C

length : Number
Number of options in the options array for the element.
No Details 3.0+ 1.0+ 2.0+ 7.0+ 5.0+ 1.0+
options : Array
If the element is a Select list, specifies the list of options (as an array) for the element.
No Details 3.0+ 1.0+ 2.0+ 7.0+ 5.0+ 1.0+
selectedIndex : String
If the element is a Select list, specifies the index of the selected option in the options array.
No Details 3.0+ 1.0+ 2.0+ 7.0+ 5.0+ 1.0+

Functions

Method Action IE Mozilla Netscape Opera Chrome Safari
blur() : Object
Removes focus from the element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 5.0+ 1.0+

Returns
Object

Availability

JavaScript 1.0|W3C

click() : Object
Simulates a mouse click on the element. Does not invoke the onClick event handler.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 5.0+ 1.0+

Returns
Object

Availability

JavaScript 1.0|W3C

focus() : Object
Gives focus to the element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 5.0+ 1.0+

Returns
Object

Availability

JavaScript 1.0|W3C

select() : Object
Selects the text of the element, if applicable.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 5.0+ 1.0+

Returns
Object

Availability

JavaScript 1.0|W3C

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

text_javascript aptana_docs