The task has the form:
Create a page with a button; when you click on a button, a paragraph with arbitrary text should be created on the page. After creating 10 paragraphs, all of them should be deleted.
Do I have a hitch like after creating 10 paragraphs delete them ?!
function createNewPar() { var list = document.getElementById("test"); var item = document.createElement("p"); item.innerHTML = "NEW ITEM"; list.appendChild(item); } <div id="test"></div> <input type="button" value="Add Par" onclick="createNewPar()" />