Dane
0
Q:

how to inserthtml new tag


<div id="div1">

 
<p id="p1">This is a paragraph.</p>

 
<p id="p2">This is another paragraph.</p>

</div>

<script>

var para = document.createElement("p");

var node = document.createTextNode("This is new.");

para.appendChild(node);


 var
element = document.getElementById("div1");

element.appendChild(para);

</script> 
0

New to Communities?

Join the community