Javascript examples for DOM HTML Element:OptionGroup
OptionGroup disabled Property - Find out if an option-group is disabled or not:
<!DOCTYPE html> <html> <body> <select size="6"> <option value="B">B</option> <option value="M">M</option> <optgroup id="myOptgroup" label="Swedish Cars"> <option value="css">CSS</option> <option value="html">HTML</option> <option value="sql">SQL</option> </optgroup> </select>//from w w w . ja v a 2s . c o m <button onclick="myFunction()">Test</button> <script> function myFunction() { var v = document.getElementById("myOptgroup").disabled; console.log(v); } </script> </body> </html>