I try to wrap a text in this code
<div class="div">
<span></span>
<a></a>
*text I want to wrap*
<span></span>
</div>
I know what the text is, but I can’t know what is his position in the div
$(".div:contains('*text*')")
I get the right div like that, but I can’t figure out how to wrap my text
most simple method will be take the html of parent Element and replace the string with new string
Now place back the new Html to The parent div
Example fiddle