Is there a way to remove text that is not wrapped in any tag using jQuery
This is some text This is \"unwrapped\" text //to be removed &
This is some text
Using the answer from this question:
$(elem) .contents() .filter(function() { return this.nodeType == 3; //Node.TEXT_NODE }).remove();