JSFiddle - React, Tailwind, and code Playground

HTML

<div class="thecontent">
    any amount of text or html elements before
<b>
    the bolded text
</b>
<br />
the text I need together with the bolded text which can contain other html elements apart from line breaks and bolded blocks
<br />
<b>
    posibility of more bolded and text couples further in the div
</b>
<br />
and some more text to go with the bolded text
       
</div>

JavaScript

var elem    = $('.thecontent').get(0).childNodes,
    content = {},
    i = 0;

for (key in elem) {
    var type = elem[key].tagName ? elem[key].tagName : 'text';
    content[i] = {};
    content[i][type] = elem[key].tagName == 'B' ? $(elem[key]).text() : elem[key].nodeValue;
    i++;
}

console.log( content );