Get Li Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Li


The Li object represents an HTML <li> element.

You can access a <li> element by using getElementById():

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

  <li id="myLi">CSS</li>
</ol>//from   w w w  . j a  va2 s  . c o  m

<button onclick="myFunction()">set the list items to increment from the number "3" instead of "1"</button>

function myFunction() {
    var x = document.getElementById("myLi");
    x.value = "3";


Related Tutorials