I would like clearly display some text coded in html, at the moment I use this script.
Replace method works but I cannot display the text in a readable format in my case
“Hello!”
Any idea how to solve it?
Thanks
HTML :
<span class="sp">test</span>
JS :
$(document).ready(function() {
$('span.sp').each(function(i) {
var text = $(this).text();
var name = text.replace("test", "Hello!");
$(this).text(name);
});
});
Try this: