When someone comment on Blogger with
[img][/img] tag then this HTML code is published. Assume the code like that
<div id="mm">[img]https://www.gravatar.com/avatar/4ce47f47105a3bd1ca4700f02b5deff1?s=32&d=identicon&r=PG[/img]</div>
Our javascript should find the [img] tag and replace that with an image. So javascript may be like this:
var s;
s = document.getElementById("mm").innerHTML
s = s.replace("[img]","'");
s = s.replace("[/img]","'");
var b;
b = "<img src="+s+"></img>"
document.getElementById("mm").innerHTML = b;
it works when the div id="mm" contains only [img] [/img] tag. but when their is other text or code then it fails to thdisplay e image. Please help me. Thanks in advance