Javascript Reference - HTML DOM Input Range type Property








The type property get type string of the slider control.

Browser Support

type Yes Yes Yes Yes Yes

Syntax

var v = rangeObject.type

Return Value

A String type value representing the type of the slider control.





Example

The following code shows how to get the type string of the slider control.


<!DOCTYPE html>
<html>
<body>
<!--from  www .  ja v  a  2s .  co  m-->
<input type="range" id="myRange">
<button onclick="myFunction()">test</button>

<p id="demo"></p>

<script>
function myFunction() {
    var x = document.getElementById("myRange").type;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

The code above is rendered as follows: