Input Range type Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Range

Description

The type property returns which type of form element the slider control is.

Return Value

A String, representing the type of form element the slider control is

The following code shows how to return which type of form element the slider control is:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<input type="range" id="myRange">

<button onclick="myFunction()">Test</button>

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

<script>
function myFunction() {/*from   w ww  .  j ava2s  .  c o  m*/
    var x = document.getElementById("myRange").type;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials