Javascript DOM <UL> element create
<!DOCTYPE html> <html> <body> <script type="text/javascript"> let shoppingList = [// ww w . j a v a 2s. com "Eggs", "Milk", "Juice", "Diapers", "Bread" ]; let ul = document.createElement("ul"); for (let i = 0; i < shoppingList.length; i++) { ul.innerHTML = ul.innerHTML + "<li>" + shoppingList[i] + "</li>"; } document.body.appendChild(ul); </script> </body> </html>