JSFiddle - React, Tailwind, and code Playground

by George Y

HTML

<div id="texting">
<strong style="font-weight:600">Hello world</strong><span style="font-weight:600">Hello world</span>
<strong style="font-weight:800">Hello world</strong>
</div>

JavaScript

var text = $('#texting').html()
  
  while ((m = stylesData[style]['regexB'].exec(text)) !== null) {
            if (m.index === stylesData[style]['regexB'].lastIndex) {
                stylesData[style]['regexB'].lastIndex++;
            }
            text = text.replace(m[1], '');
        }