I am trying to replace the javascript code in html by javascript
So I am testing like this.
var test = new String("<script type=\"text/javascript\"> test </script>");
test.replace(/<script type=\"text\/javascript\">.+<\/script>/g,"");
//this doesn't match
console.log(test.toString());
test.replace doesn't match and console.log shows this.(nothing happens!)
<script type="text/javascript"> test </script>
Is there any mistake??