Skip to main content

在富文本编辑框中复制粘贴时去掉html格式

Published 1 min readMarkdown
document.querySelector("div.pasteEditor").addEventListener("paste", function(e) { e.preventDefault(); var text = e.clipboardData.getData("text/plain"); document.execCommand("insertText", false, text); });

No comments yet. Be the first to comment.

More from this blog