Javascript examples for DOM HTML Element:Li
Output array to <LI> element
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {/*from w ww.j a v a2 s . co m*/ var books = [ "F", "T", "N" ]; var html = ""; for (var i =0; i < books.length; i++) { html += "<li>" + books[i]+ "</li>"; } document.getElementById("books").innerHTML = html; }); </script> </head> <body> <ol id="books"> </ol> </body> </html>