Help Center

Local Navigation

Object: HTMLInputElement

Availability

BlackBerry® Device Software version 4.6 or later

Extends

HTMLElement

The HTMLInputElement object represents an <input> element in an HTML document.

The <input> element defines a user input object.

HTMLInputElement properties

Property name

Type

Description

Status

Support level

Availability

accept

DOMString

Specifies a comma-separated list of content types that this form accepts.

writable

DOM 2 HTML

4.6 or later

accessKey

DOMString

Specifies the keypad key that gives access to the element.

writable

DOM 2 HTML

4.6 or later

align

DOMString

Specifies the vertical or horizontal alignment of the image on the page.

writable

DOM 2 HTML

4.6 or later

alt

DOMString

When HTMLInputElement.type has a value of image, specifies the text that appears when an image is unavailable or cannot be displayed.

writable

DOM 2 HTML

4.6 or later

checked

boolean

When true and HTMLInputElement.type has a value of checkbox or radio, indicates that the check box or radio button appears selected, and its value is included when the form is submitted.

writable

DOM 2 HTML

4.6 or later

defaultChecked

boolean

When true and HTMLInputElement.type has a value of checkbox or radio, indicates that the input control is initially selected.

The value of this property does not change if the state of the input control within the form changes.

writable

DOM 2 HTML

4.6 or later

defaultValue

DOMString

When HTMLInputElement.type has a value other than button, checkbox, hidden, image, reset, or submit, specifies the initial value of the form control.

The value of this property does not change if the contents of the form control within the form changes.

writable

DOM 2 HTML

4.6 or later

disabled

boolean

When true, indicates that the form control is not available.

writable

DOM 2 HTML

4.6 or later

form

HTMLFormElement

Returns the parent <form> element for the form control.

read only

DOM 2 HTML

4.6 or later

list

HTMLElement

Returns the associated <datalist> element containing the list of value suggestions, if one exists. If no associated <datalist> element exists, this property returns null.

read only

HTML 5

4.7.1 or later

maxLength

int

When HTMLInputElement.type has a value of email, password, search, text, or url, specifies the maximum number of characters permitted as input into the text field.

writable

DOM 2 HTML

4.6 or later

name

DOMString

Specifies the amount of whitespace padding added to the top and bottom of the image.

writable

DOM 2 HTML

4.6 or later

readonly

boolean

When HTMLInputElement.type has a value of of email, password, search, text, or url and this property is true, indicates that the form control cannot be modified by a user.

writable

DOM 2 HTML

4.6 or later

size

int

Specifies the size of the form control.

writable

DOM 2 HTML

4.6 or later

src

DOMString

When HTMLInputElement.type has a value of image, specifies the URI of the source image.

writable

DOM 2 HTML

4.6 or later

tabIndex

int

Specifies the element’s position in the tabbing order.

writable

DOM 2 HTML

4.6 or later

type

DOMString

Specifies the type of form control this input element is.

writable

DOM 2 HTML

4.6 or later

useMap

DOMString

When HTMLInputElement.type has a value of image, specifies the client-side map to use with this image.

writable

DOM 2 HTML

4.6 or later

value

DOMString

Specifies the current value of the form control. This is the value portion of the name-value pair that is submitted with the form.

writable

DOM 2 HTML

4.6 or later

valueAsDate

long

Specifies the value of the element interpreted as a date. The browser represents this number as the number of milliseconds elapsed from origin (Midnight UTC, the morning of January 1, 1970).

This property can be used with all date- and time-based input types, excluding the datetime-local input type.

writable

HTML 5

4.7.1 or later

valueAsNumber

float

Specifies the value of the element interpreted as a number.

This property can be used with the number and range input types.

writable

HTML 5

4.7.1 or later

HTMLInputElement methods

Method name

Description

Support level

Availability

blur()

Removes keypad focus from the element.

DOM 2 HTML

4.6 or later

click()

Simulates a mouse click.

DOM 2 HTML

4.6 or later

focus()

Gives keypad focus to the element.

DOM 2 HTML

4.6 or later

select()

Selects the contents of the element.

DOM 2 HTML

4.6 or later


Was this information helpful? Send us your comments.