if i have a string like
<p>this is some content</p><script>alert('hello');</script>
i want to get the string without any scripts, but with the formatting, how do i do it?
<p>this is some content</p>
i tried
var html = "<p>etc</p><script>alert('hello world');</script>".replace("<script*</script>", "p");
but that gave me something like
".replace("", "p"); $('#blogDescription').html(html); }); });
You can do this without using regex, by using some DOM manipulation you can run through each of the elements in the DOM fragment created from the string and remove the
scripttags.Or with jQuery