$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
Clean way to remove text and keep div inside a div jquery
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});
$(function() {
$("#to-clean, #to-clean *") // selects the element and all element nodes inside it
.contents() // selects all child nodes including tags, comments and text
.filter(function() {
return this.nodeType === Node.TEXT_NODE; // filter text nodes
}).remove(); // boom!
});