YouTip LogoYouTip

Dom Obj Number

# HTML DOM Input Number Object * * * ## Input Number Object The Input Number Object is new in HTML5. The Input Number Object represents an HTML `` element with `type="number"`. **Note:** Internet Explorer 9 and earlier versions do not support `` elements with the `type="number"` attribute. ### Accessing an Input Number Object You can use the `getElementById()` function to access an `` element with the `type="number"` attribute: ```javascript var x = document.getElementById("myNumber"); (#) **Tip:** You can also access the Input Number Object through the form's (#) collection. ### Creating an Input Number Object You can use the `document.createElement()` method to create an `` element with the `type="number"` attribute: ```javascript var x = document.createElement("INPUT"); x.setAttribute("type", "number"); (#) ## Input Number Object Properties | Property | Description | | --- | --- | | autocomplete | Sets or returns the autocomplete attribute value of the number field | | (#) | Sets or returns whether the number field should automatically get focus when the page loads | | defaultValue | Sets or returns the default value of the number field | | (#) | Sets or returns whether the number field is disabled | | (#) | Returns a reference to the form that contains the number field | | labels | Returns a list of label elements associated with the number field | | list | Returns a reference to the datalist that contains the number field | | max | Sets or returns the max attribute value of the number field | | min | Sets or returns the min attribute value of the number field | | (#) | Sets or returns the name attribute value of the number field | | (#) | Sets or returns the placeholder attribute value of the number field | | (#) | Sets or returns whether the number field is read-only | | (#) | Sets or returns whether the number field must be filled out before submitting a form | | step | Sets or returns the step attribute value of the number field | | (#) | Returns the form element type of the number field | | (#) | Sets or returns the value attribute value of the number field | ## Standard Properties and Events The Input Number Object also supports standard (#) and (#). *
← Prop Number AutofocusProp Month Value β†’