Best and easy solution to remove all text elements from certain div is
$("#firstDiv").contents().filter(function(){
return (this.nodeType == 3);
}).remove();
More Related Contents:
- How to change the element of another div by clicking and hovering on an element of a different div
- Hide/Show div on specific page with jquery
- Jquery mouseenter() vs mouseover()
- Code for a simple JavaScript countdown timer?
- Get an element by index in jQuery
- How do I make jQuery Contains case insensitive, including jQuery 1.8+?
- Why does Chrome ignore local jQuery cookies?
- Custom events in jQuery?
- jQuery cross domain iframe scripting
- jQuery find closest previous sibling with class
- How can I keep Bootstrap popovers alive while being hovered?
- jqGrid data stored in browser cache?
- $ versus jQuery
- jQuery ui datepicker with Angularjs
- jQuery Ajax wait until all images are loaded
- jQuery dollar sign ($) as function argument?
- Set Focus After Last Character in Text Box
- How to get the position of a draggable object
- jQuery stopPropagation bubble down
- How to create a direct link to any fancybox box
- Setting min date in jQuery datepicker
- jquery array group by
- How to cancel navigation when user clicks a link ( element)?
- Capture 404 status with jQuery AJAX
- jQuery Validation plugin: validate check box
- JQuery, Flot, valuelabels, center
- Jquery find all ids starting with a string?
- jQuery on load of dynamic element
- jQuery: find input field closest to button
- How to include JavaScript files by h:outputScript? [duplicate]