Here's one way to do it with jQuery using the contains() selector:
http://docs.jquery.com/Selectors/contains
if ( $("#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.asp
or something.
On Nov 6, 4:24*pm, Wacko Jacko <jackson.be... (AT) gmail (DOT) com> wrote:
Quote:
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
|