HTMLInputElement object

This topic has not yet been rated - Rate this topic

Implements the document object model (DOM) representation of the input element.

DOM Information

Inheritance Hierarchy

 Node
  Element
   HTMLElement
     HTMLInputElement

Members

The HTMLInputElement object has these types of members:

Methods

The HTMLInputElement object has these methods.

MethodDescription
checkValidity

Returns whether a form will validate when it is submitted, without having to submit it.

getBoundingClientRect

Retrieves an object that specifies the bounds of a collection of TextRectangle objects.

getClientRects

Retrieves a collection of rectangles that describes the layout of the contents of an object or range within the client. Each rectangle describes a single line.

setCustomValidity

Sets a custom error message that is displayed when a form is submitted.

stepDown

Decrements a range input control's value by the value given by the Step attribute.

stepUp

Increments a range input control's value by the value given by the Step attribute.

 

Properties

The HTMLInputElement object has these properties.

PropertyDescription

autocomplete

Specifies whether autocomplete is applied to an editable text field.

autofocus

Provides a way to direct a user to a specific field when a document loads.

files

Returns a FileList object on a file type input object.

formAction

Overrides the action attribute (where the data on a form is sent) on the parent form element.

formEnctype

Used to override the encoding (formEnctype attribute) specified on the form element.

formMethod

Overrides the submit method attribute previously specified on a form element.

formNoValidate

Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation.

formTarget

Overrides the target attribute on a form element.

list

Specifies the ID of a pre-defined datalist of options for an input element.

max

Defines the maximum acceptable value for an input element with type="number".

maxLength

Sets or retrieves the maximum number of characters that the user can enter in a text control.

min

Defines the minimum acceptable value for an input element with type="number".

multiple

When used with the type="file" attribute, allows multiple files to be selected in the file selection dialog.

pattern

Gets or sets a string containing a regular expression that the user's input must match.

placeholder

Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.

required

When present, marks an element that can't be submitted without a value.

selectionEnd

Gets or sets the end position or offset of a text selection.

selectionStart

Gets or sets the starting position or offset of a text selection.

spellcheck

Specifies whether spell checking is applied to an editable text field.

src

Sets or retrieves a URL to be loaded by the object.

step

Defines an increment or jump between values that you want to allow the user to enter.

type

Retrieves or initially sets the type of input control represented by the object.

validationMessage

Returns the error message that would be displayed if the user submits the form, or an empty string if no error message.

validity

Returns a ValidityState object that represents the validity states of an element.

valueAsNumber

Returns the input field value as a number.

willValidate

Returns whether an element will successfully validate based on forms validation rules and constraints.

 

 

 

Build date: 11/28/2012

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.