Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js unwrap element

// select element to unwrapvar el = document.querySelector('div');
// get the element's parent nodevar parent = el.parentNode;
// move all children out of the elementwhile (el.firstChild) parent.insertBefore(el.firstChild, el);
// remove the empty elementparent.removeChild(el);
Source by plainjs.com #
 
PREVIOUS NEXT
Tagged: #js #unwrap #element
ADD COMMENT
Topic
Name
3+3 =