Q:

How to remove image elements from string that has specific alt= value?

I have a string that contains HTML image elements that is stored in a var.
I want to remove those image elements that has alt="today" and leave the rest of images untouched .
<img src="./images/ok.gif" alt="today" />

I have tried: 
var replaced2 = content.replace(/\<img src="./images/ok.gif" alt="today" />\/g,'');

but had no luck.
Can anyone help me out at all?
Thanks

A:

Try this as your regular expression: 
/<img src=".\/images\/ok.gif" alt="today" \/>/g

Gotta make sure to escape any forward slashes because they denote a regexp
/<regexp syntax>/

