Answers for "remove all html inside div jquery"

8

delete all child elements jquery

$("div").empty();
Posted by: Guest on June-17-2020
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 "remove all html inside div jquery"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language