<ul></ul>
var ul = document.getElementsByTagName("ul")[0]; // assuming it exists
var docfrag = document.createDocumentFragment();
var browserList = ["Internet Explorer", "Firefox", "Safari",
"Chrome", "Opera"];
console.log(docfrag)
browserList.forEach(function(e) {
var li = document.createElement("li");
li.textContent = e;
docfrag.appendChild(li);
});
console.log('ddd')
console.log(docfrag)
ul.appendChild(docfrag);
// a list with well-known web browsers
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.