Javascript examples for DOM HTML Element:Option
Option label Property - Return the label value of an option in a drop-down list:
<!DOCTYPE html> <html> <body> <select> <option label="c">cc</option> <option id="myOption" label="d">dd</option> </select>/* ww w. j a va2 s . c o m*/ <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { var v = document.getElementById("myOption").label; document.getElementById("demo").innerHTML = v; } </script> </body> </html>