Añadir un hijo a un elemento de HTML (p.ej. un div)


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. newnode=document.createElement("span");
  2. newnode.innerHTML="<div id=\"editMessageContainer\"> blah </div>";
  3. document.body.appendChild(newnode);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.