Re: inserting javascript into an element

> 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.

Received on Thursday, 6 December 2001 13:25:24 UTC