Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery clear text in div

// removes only text, no changes to children
$('#YourDivId').contents().filter((_, el) => el.nodeType === 3).remove();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jquery #clear #text #div
ADD COMMENT
Topic
Name
2+6 =