Thanks so much for the quick response. That works a treat.
Can I take it one step further and only attach it to direct children? e.g.... the <b> gets left out (and any other sub sub elements).
Tom
P.S. JQuery rocks... you're a god. You might actually be the god. ;)
On 10/20/06, John Resig <[EMAIL PROTECTED]
> wrote:
Something like this:
$("#wrapper > *").hover( ... );
The > lets you select all child elements, which is what you want. Enjoy!
--John
> How can I attach the hover event to all elements in another element?
>
> For example:
>
> <div id="wrapper">
> <h1>Hello</h1>
> <p>Test hello</p>
> </div>
>
> I want to add the .hover event to <h1> and <p> within the <div
> id="wrapper">. The amount of elements could obviously change.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/
--
Tom Holder
Managing Director
Atom Software Ltd
t: 01722 770001
f: 0117 923 9922
_______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
