Convert HTML to plain text in contentEditable

后端 未结 4 1868
忘了有多久
忘了有多久 2021-02-07 07:10

I have a contentEditable and I strip the formatting of pasted content on(\'paste\') by catching the event. Then I focus a textarea, paste the content i

4条回答
  •  我在风中等你
    2021-02-07 07:50

    1. Create an external div,
    2. Put your html in that div,
    3. Copy the text from that div
    4. Insert it at the cursor's position.

提交回复
热议问题