On 6 Feb, 15:20, Monkeytail <[EMAIL PROTECTED]> wrote: > When the page loads, all div's with class 'foo' that have an h4 > element that contains 'bar' must show up in red (the div, not h4). The > div's that are not containing <h4>bar</h4> stay 'default'.
Hi and welcome :) this wil do: $("div.foo:has(h4:contains('bar'))").css("color", "red"); this line looks for the div which has class "foo" and has an <h4> that contains 'bar'.