Javascript examples for DOM HTML Element:Ul
Create <UL> and <LI> and add <LI> to <UL> element
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <div id="output"> </div> <script type="text/javascript"> var _ul = document.createElement('ul'); var _li= document.createElement('li'); _li.innerHTML="Something"; _ul.appendChild(_li); document.getElementById("output").appendChild(_ul) </script> </body>/*from ww w . ja va 2 s .c o m*/ </html>