add list item to ul javascript code example
Example 1: append li to ul javascript
function function1() {
var ul = document.getElementById("list");
var li = document.createElement("li");
li.appendChild(document.createTextNode("Four"));
ul.appendChild(li);
}
Example 2: how to add list in javascript
print(list)
Example 3: how to add list in javascript
list=["elements"]#add elements by seperating with comma