Hello guys,
I'd like to find with jquery some specific text, and replace it with a renewed version including some HTML.
I've tried this, which is working when I use only text:
<script type="text/javascript" >
jQuery(document).ready(function(){
jQuery("*").contents().each(function() {
if(this.nodeType == 3)
this.nodeValue = this.nodeValue.replace("hello mum", "bye bye mum");
});
})
</script>
However, if I add some text + HTML to replace the targeted expression, it gets "formatted" and is read as plain text...
Do you know guys some solution to this problem? Can I add HTML to the replacing expression?
Thanks.