W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2001

Re: inserting javascript into an element

From: alex <shortestpath@yahoo.com>
Date: Thu, 6 Dec 2001 13:04:03 -0800 (PST)
Message-ID: <20011206210403.43470.qmail@web14503.mail.yahoo.com>
To: Boris Zbarsky <bzbarsky@MIT.EDU>
Cc: www-dom@w3.org
Hi Boris, thanks for the help. It worked- kinda.

It seems IE 5+ doesn't support addEventListener.
IE5+ has got its own thing called attachEvent
(found that online).

The whole point of me using DOM in the first place
was so that I woun't have to test for browsers. 
But now it seems I have to. Ironic I think...
-alex

--- Boris Zbarsky <bzbarsky@MIT.EDU> wrote:
> > var e = document.createElement("select");
> > e.setAttribute("onchange", "alert('option changed')");
> 
> You want to use addEventListener instead of setAttribute, at a guess.
> 
> Boris
> -----------------
> 617-864-9910
> -----------------
> Ray's Rule of Precision:
>    Measure with a micrometer.  Mark with chalk.  Cut
> with an axe.

__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com
Received on Thursday, 6 December 2001 16:04:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:55 GMT