Change element's parent


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



Copy this code and paste it in your HTML
  1. //method to change an elements parent
  2. function setParent(el, newParent) {
  3. newParent.appendChild(el);
  4. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.