Input Range typeProperty

Input Range 对象参考手册Input Range Object

Example

Returns the form element type of the slider control:

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

xThe output result is:

range

Try it yourself »

Definition and Usage

The type property returns the form type of the slider control.

In the example above, Internet Explorer 9 and earlier IE versions will return "text" instead of "range". Internet Explorer 10 (and later), Firefox, Opera, Chrome, and Safari browsers will return "range".


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the type property.

Note:Internet Explorer 9 and earlier IE versions do not support HTML <input> elements with the type="range" attribute.


Syntax

rangeObject.type

Technical Details

Return value: A string representing the form element type of the slider control


Input Range 对象参考手册Input Range Object Other Extensions