Latest web development tutorials

HTML DOM Input Number Object

Input Number Object

Input Number object is a new HTML5.

Input Number object representation using type = "number" of the HTML <input> elements.

Note: Internet Explorer 9 and earlier versions of IE do not support the use of type = "number" <input> element attributes.

Access Input Number objects

You can use getElementById () function to access using type = "number" <input> element attributes:

var x = document.getElementById ( "myNumber" ); try

Tip: You can also form elements to access the Input Number collection of objects.

Create Input Number Object

You can use document.createElement () method to create using the type = "number" attribute of the <input> element:

var x = document.createElement ( "INPUT");
x.setAttribute ( "type", "number "); try

Input Number Object Properties

Attributes description
autocomplete Sets or returns the number of fields autocomplete attribute value
autofocus Sets or returns the number field is automatically get the focus when the page loads
defaultValue Sets or returns the number of default field values
disabled Sets or returns the number field is available
form Returns reference number form field
labels Back to TAG list of elements number field
list It returns the number of fields referenced datalist
max Sets or returns the number field max attribute value
min Sets or returns the number of fields property values ​​min
name Sets or returns the number field name attribute value
placeholder Sets or returns the number field placeholder attribute value
readOnly Sets or returns the number field is read-only
required Sets or returns the number of fields in the form if a required field
step Sets or returns the number of step fields property values
type Returns the number of fields form element type
value Sets or returns the number field value attribute value

Standard properties and events

Also supports standard Input Number Object properties and events .


related articles

HTML Tutorial: HTML Forms

HTML Reference Manual: HTML <the INPUT> tag

HTML Reference Manual: HTML <the INPUT> of the type attribute