Posted By

ecavazos on 01/22/08


Tagged

childnodes removechild


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

certainlyakey


Remove Children From Node


 / Published in: JavaScript
 

  1. function removeChildrenFromNode(node) {
  2. if(node.hasChildNodes()) {
  3. while(node.childNodes.length >= 1 ) {
  4. node.removeChild(node.firstChild);
  5. }
  6. }
  7. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: aaajjj on November 14, 2008

node.innerHTML = '';

You need to login to post a comment.