Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Input Number type Property

Input Number type Property

Input Number Object Reference Input Number Object

Example

Return the form element type of the number field:

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

x The output result is:

number

Try it »


Definition and Usage

The type property returns the form element type of the number field.

In an input number, this property usually returns "number".


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the type property

Note: Internet Explorer 9 and earlier versions do not support the HTML using the type="number" attribute .


Syntax

numberObject

.type

Technical Details

Return Value: A string representing the form element type of the number field

Input Number Object Reference Input Number Object