🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
~~~ <textarea name="" id="txt" cols="30" rows="10"></textarea> <button id="filter">过滤</button> <script> var txt = document.getElementById("txt"); var filter = document.getElementById("filter"); var reg = /天猫|淘宝/g; filter.onclick = function(){ var content = txt.value; var filterContent = content.replace(reg,"**"); txt.value = filterContent; } </script> ~~~