--- In [email protected], "ddailey" <ddai...@...> wrote:
>
> Hi folks,
> 
> I've always used something like 
> 
>     O.setAttribute("onclick","add(evt)")  
> 
> to attach an event handler in SVG. But someone told me recently that 
> 
>     O.addEventListener("click", function(evt){add(evt)}, false)

O.addEventListener("click", add, false)

should work just fine.  Is there a browser where it doesn't?  I don't see any 
advantage to wrapping that function call in another function. 

The third argument specifies whether you want to handle the event during the 
bubble or the capture phase (not possible using the onclick attribute).

Another advantage to using addEventListener is that multiple handlers for the 
same event can be added.

Regards,
Jeff



------------------------------------

-----
To unsubscribe send a message to: [email protected]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
----Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/svg-developers/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to