SyntaxFix
Write A Post
Hire A Developer
Questions
Try this:
var text = text.replace(/<script[^>]*>(?:(?!<\/script>)[^])*<\/script>/g, "")