JSFiddle - React, Tailwind, and code Playground
by toubia95
HTML
<div contenteditable="true" id='test'>text text more text <span>and a text in a span</span></div>
JavaScript
var contenteditable = document.querySelector('[contenteditable]'),
text = contenteditable.textContent;
console.log(text)