It still doesn't work. I think part of the problem is because the
children of main are added after I create the event listener.

Second solution is to check in the event listener if the target is a
child of main and if so, return.  I know how to get the children of
main , but how to I check the current tartget is one of them ?

ricardobeat> I need to select all objects of the page because I want
to do a DOM inspector. But yes you are right, maybe I should only
start from body !

Thanks

On 20 nov, 18:25, ricardobeat <[EMAIL PROTECTED]> wrote:
> Are you sure you want to apply it to *all* elements on the page? That
> sounds a bit awkward.
>
> var main =  $('#main, #main *');
> $('body *').not(main).mouseover(function(){...});
>
> On Nov 20, 2:07 pm, "[EMAIL PROTECTED]"
>
> <[EMAIL PROTECTED]> wrote:
> > Hi,
>
> > I want to apply a mouseover event on all elements but one and its
> > children. I can't use class name to filter. How can I do it ?  I've
> > tried unsuccessfully :
>
> > $("*:not(#main)").not($("#main").children()).mouseover(function() {
>
> > });
>
> > thanks

Reply via email to