Use Textarea

We can not directly submit rich text in textarea . Instead, you should use editor.config.onchange to update textarea content:

<div id="div1">
    <p>webcomle use <b>wangEditor</b> rich text editor</p>
<textarea id="text1" style="width:100%; height:200px;"></textarea>

<script src=""></script>
<script type="text/javascript" src="//"></script>
<script type="text/javascript">
    const E = window.wangEditor
    const editor = new E('#div1')
    const $text1 = $('#text1')
    editor.config.onchange = function (html) {
                // step two,observe change, sync update to textarea
        // frist,init textarea value
Copyright © wangEditor (2020 - present) all right reserved,powered by GitbookFile Modify: 2022-04-11 06:40:29

results matching ""

    No results matching ""