Suppose I have a string of HTML code. I want to use JQuery to remove all tags from the string.
How can I do that?
Note: I want t
Old question, but if you are still looking for the easiest way to remove scripts from a string try
$.parseHTML(string);
$.parseHTML() automatically removes script tags from strings.
Edit:
This works because keepScripts has false value as default. (Reference: $.parseHtml)
$.parseHTML(data, context, keepScripts)