Javascript examples for DOM HTML Element:Li
Li value Property - Return the value of a list item:
<!DOCTYPE html> <html> <body> <ol> <li id="myLi" value="100">A</li> <li>B</li> <li>C</li> </ol>/*from ww w . ja va2 s. c o m*/ <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myLi").value; document.getElementById("demo").innerHTML = x; } </script> </body> </html>