[thelist] JavaScript onClick question.

Craig cd-ml at aardvark.net.au
Mon Aug 23 05:31:38 CDT 2004


Hi Tim,

Yes, I will look into event bubbling

However if I add this onclick [1] to the link it will cancel the div's
onclick alert.

[1] onclick="document.getElementById('thediv').onclick=null;"

Regards,
Craig.

----- Original Message ----- 
From: "Tim Beadle" <Tim.Beadle at iop.org>
To: <thelist at lists.evolt.org>
Sent: Monday, August 23, 2004 7:31 PM
Subject: Re: [thelist] JavaScript onClick question.


> thelist-bounces at lists.evolt.org wrote on 22/08/2004 16:04:59:
> > There is a DIV with an onClick alert, and a link with an onClick alert.
> > What happens is if you click on the Link, the JS alert will popup "a
> > onClick" and then "div onClick".
> >
> > How can I make it only popup "a onClick" ??
>
> Remove the div onclick? :)
>
> You might wish to look into how events are handled in different browsers.
> I know IE uses one method and Moz another, and that one method is called
> "event bubbling".
>
> HTH,
>
> Tim




More information about the thelist mailing list