Js string full substitution function share

  • 2020-03-30 04:30:41
  • OfStack

These days used js string completely replace the function, what do not say, directly on the code, need to copy can:


<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title></title>
        <script type="application/javascript">
            function testStr(){
                var temp=document.getElementById("content").value;
                var newContent=temp.replace(/"/g,''');
                alert(newContent);
            }
        </script>
    </head>
    <body>
        <textarea id="content"></textarea>
        <input type="button" value=" work " onclick="testStr();"/>
    </body>
</html>


Related articles: