Created
November 23, 2018 02:52
-
-
Save kalysr/adfa55ec15362e7a4e0f9769eb8c8b58 to your computer and use it in GitHub Desktop.
When you using contenteditable div add this function for clear format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const onPaste = (e) => { | |
e.preventDefault(); | |
let text = e.clipboardData.getData("text/plain"); | |
document.execCommand("insertText", false, text); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment