JSFiddle - React, Tailwind, and code Playground

HTML

<p id="el"></p>

CSS

#el {
    width: 30px;
    border: 1px solid red;   
}

JavaScript

$('#el').html('ex&shy;am&shy;ple');
console.log($('#el').html()); // nope, no hyphens
console.log($('#el').contents().get(0).nodeValue); // no hyphens, either

console.log($('#el').html() == 'ex&shy;am&shy;ple')
console.log($('#el').contents().get(0).nodeValue == 'ex&shy;am&shy;ple')