JSFiddle - React, Tailwind, and code Playground

HTML

<div id="d1"><span>1.</span>Hallo <span>Kitty, </span><div>How are you?</div></div>

JavaScript

var text = $("#d1").contents().filter( function() {
    return this.nodeType === 3;
}).text();

console.log(text);