Search code examples
javascriptjqueryhtmlcontenteditable

Get plain text from contenteditable div


Is it possible to extract the plaintext from a contenteditable div, including newlines? The jQuery $.text() method strips out newlines, which I need. The solution can use jQuery.


Solution

  • With a bit of tweaking, https://github.com/vorushin/jsHtmlToText was just what I needed.