Please Guys, I am new to Jquery. I have been searching for a suitable help since last week but I can\'t find any. I want to replace a text with a smiley image using jquery but I
It is actually quite simple.
You only need one line to find and replace string instances in the HTML:
$("body").html($("body").html().replace(/:happy;/g,''));
This sets $("body").html()
to the $("body").html()
with :happy;
replaced with .
/:happy;/g
is RegEx to find the string :happy;
globally (g
)
https://jsfiddle.net/heowqt1u/2/