Answers for "jquery clear text in div"

2

jquery clear text in div

// removes only text, no changes to children
$('#YourDivId').contents().filter((_, el) => el.nodeType === 3).remove();
Posted by: Guest on September-01-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language