JSFiddle - React, Tailwind, and code Playground

HTML

<span id="span_id" style="background: #6ff"></span>
<svg width="200" height="200"  viewBox="0 0 200 200">
    <text>
        <tspan x=50 y=50>Test:</tspan>
        <tspan x=50 y=70 id="tspan_id"></tspan>
    </text>
</svg>

JavaScript

var txt = $('<div />').html('&lt;span>text pls</span>').text();
$('#tspan_id').text(txt);