Forum Moderators: open

Message Too Old, No Replies

attachEvent('onclick', myfunction)

firefox attachevent onclick

         

blackeagle2

12:24 am on Nov 16, 2005 (gmt 0)

10+ Year Member



Hi!

I have a problem with a script on a tutorial that contains :

document.body.attachEvent('onclick',myfunction);

it is not compatible with firefox ...

Do someone have an idea on how to make it work with firefox?

Thanks

Bernard Marx

1:03 am on Nov 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



you need addEventListener('click', myfunction, false).

Here's the lowdown: [scottandrew.com...]

blackeagle2

2:06 am on Nov 16, 2005 (gmt 0)

10+ Year Member



thanks it works like a charm!