Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

remove text in div JQuery zqqqqqqqqqqqqqqqzzzzzzzzzzzzzzzzzzzzzzzzzzzzzqqqqqqqqqqqqqqqqqq

$(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!
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #text #div #JQuery #zqqqqqqqqqqqqqqqzzzzzzzzzzzzzzzzzzzzzzzzzzzzzqqqqqqqqqqqqqqqqqq
ADD COMMENT
Topic
Name
8+5 =