Advertisement
Guest User

Untitled

a guest
Jun 28th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. // vanilla
  2. var el = document.getElementById("foo"), child = el.firstChild, nextChild;
  3.  
  4. while (child) {
  5. nextChild = child.nextSibling;
  6. if (child.nodeType == 3) {
  7. el.removeChild(child);
  8. }
  9. child = nextChild;
  10. }
  11.  
  12. // jQuery
  13. $("#foo").html($("#foo").children());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement