Select disabled Property - Find out if a drop-down list is disabled or not: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Select

Description

Select disabled Property - Find out if a drop-down list is disabled or not:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<form>
<select id="mySelect">
  <option>Cats</option>
  <option>CSS</option>
</select>/*from   w  w  w  .jav a2s . c o  m*/
</form>

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

<script>
function myFunction() {
    var v = document.getElementById("mySelect").disabled;
    console.log(v);
}
</script>

</body>
</html>

Related Tutorials