I have a question. I have a work this morning but i don't know how to do it. My work here (html):
<div class="demo">
<p>this is demo text</p>
</div>
Here is my JS:
var tempdata = $(".demo").text();
var replacedata = tempdata.replace("text","<span>1234</span>");
Look everything ok. But result is: this is demo <span>1234</span>. This isn't my result I want. How to make in this string become a HTMLelement by using replace method?