Just add every li in a div and append it to the document in every iteration.
var elements = ['rock', 'paper','scissor'];
demoP = document.getElementById("demo");
elements.forEach(function(item, index) {
newlistitem = document.createElement("li");
newdiv = document.createElement("div");
newdiv.setAttribute("style", "border: 5px solid black;");
newdiv.setAttribute("id", "div_demo");
newdiv.innerHTML = "index[" + index + "]: " + item + "<br>";
demoP.appendChild(newlistitem);
newlistitem.appendChild(newdiv);
});
<ul>
<p id="demo"></p>
</ul>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…