JSFiddle - React, Tailwind, and code Playground

HTML

<div contenteditable="true">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)