HTMLInputElement : HTMLElement
Return to: HTML DOM Level 2 index

Input element on an HTML Form.

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() : HTMLInputElement

Input element on an HTML Form

Returns
HTMLInputElement

Visibility
internal

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
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

accessKey : String
Hot-key shortcut for the element.
Show Details 4.0+ no no no no no
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

align : String
Defines the alignment of the element.
Show Details 4.0+ no no no no no
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

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
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

autocomplete : String
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
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

dataFld : String
Field from a data source that is bound to the element.
No Details 4.0+ no no no no no
dataFormatAs : String
Specifies how to format the element data.
No Details 4.0+ no no no no no
dataSrc : String
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
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

defaultValue : String
Initial value for the element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

disabled : Boolean
If true, indicates that the element is disabled.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+ no

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/stylesheets.html

Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

form : HTMLFormElement
The form that contains this element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

height : Number
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
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

name : String
Unique name of the element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/attributes.html

Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

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
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

size : String
Number of characters that the field visibly holds.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+ no
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

src : String
URL for an image for the element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

status : Boolean
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
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

type : String
Type of input element.
Show Details 4.0+ 1.0+ 3.0+ 7.0+ 1.0+ no
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

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
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

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

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/attributes.html

Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

vcard_name : String
Vcard name from the profile of the user.
No Details 4.0+ no no no no no
width : Number
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
void

Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

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
void

Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

createTextRange() : textRange
Creates a new textRange object.
Show Details 4.0+ no no no no no

Returns
textRange

See Also

String

focus() : void
Places focus on the element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no

Returns
void

Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

handleEvent(Event event) : void
Process the instance of the event.
Show Details no no 4.0+ no no no

Parameters
Event event Type of event.

select() : void
For elements containing text, selects the element text.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no

Returns
void

Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

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

text_javascript aptana_docs