SOURCE

console 命令行工具 X clear

                    
>
console
const E = window.wangEditor;
const editor = new E('#editor');
editor.create();
$('#btn').click(e=>{
    editor.txt.html(`<p>${editor.txt.text().replace($('#input1').val(), $('#input2').val())}</p>`);
});
<div id="editor">
    <p>a天b小时c秒</p>
</div>
<div class="py-4">
    <input id="input1" class="border border-gray-300 p-1" type="text" value="a"> 替换为→ <input id="input2" class="border border-gray-300 p-1" type="text" value="1">
    <button id="btn" class="block mx-auto my-2 bg-indigo-500 text-white py-2 px-4 rounded">开始处理逻辑</button>
</div>
html, body {
    height: 100%;
    padding: 5px;
    background: #FFF;
}
#editor {
    width: 100%;
}

本项目引用的自定义外部资源