Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // vanilla
- var el = document.getElementById("foo"), child = el.firstChild, nextChild;
- while (child) {
- nextChild = child.nextSibling;
- if (child.nodeType == 3) {
- el.removeChild(child);
- }
- child = nextChild;
- }
- // jQuery
- $("#foo").html($("#foo").children());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement