Best and easy solution to remove all text elements from certain div is
$("#firstDiv").contents().filter(function(){
return (this.nodeType == 3);
}).remove();
Best and easy solution to remove all text elements from certain div is
$("#firstDiv").contents().filter(function(){
return (this.nodeType == 3);
}).remove();