JSFiddle - React, Tailwind, and code Playground

HTML

<p><a href="#">A nice house was <span style="color:red">found</span> in <b>Toronto</b></a></p>

JavaScript

var text = $('p');
    
    alert( text.html() );
    //Outputs <a href="#">A nice house was <span>found</span> in <b>Toronto</b></a>
    
    text.html(text.text());    

    alert( text.html() );
    ////Outputs A nice house was found in Toronto