zoukankan      html  css  js  c++  java
  • 正则替换 replace

     

    <!DOCTYPE html>
    <html lang="en">

    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
    </head>

    <body>
        <textarea name="" id="" cols="30" rows="10"></textarea>
        <button>提交</button>

        <div></div>

        <script>
            var button = document.querySelector('button');
            var textarea = document.querySelector('textarea');
            var div = document.querySelector('div');
            button.onclick = function() {
                div.innerHTML = textarea.value.replace(/激情|gay/gi, '**');
            }
        </script>
    </body>

    </html>
  • 相关阅读:
    c#剪切板操作
    eclipse mvn build error tips
    Redis Tips
    IntilliJ Idea 使用中的问题与解决方案
    mongo
    python
    SQL Relative
    sybase update
    run current vim file
    git
  • 原文地址:https://www.cnblogs.com/ericblog1992/p/13072012.html
Copyright © 2011-2022 走看看