Here's one way to do it with jQuery using the contains() selector:
http://docs.jquery.com/Selectors/containsif ( $("#box:contains('blah')").length ) {
$("#otherID").html('<img src="etc"/>');
}
Otherwise you could just get the text and use raw regular expressions,
or search()
http://www.w3schools.com/jsref/jsref_search.aspor something.
On Nov 6, 4:24 pm, Wacko Jacko <
jackson.be...@...> wrote:
> Hi People,
>
> Is this possible with jQuery: If the content within a specific id
> contains the word 'blah', display <img src="etc"/> inside this other
> id. I want to display a specific avatar in a div only if the content
> in another div contains that specific persons name.
>
> Hope this makes sense!
>
> Jack