Can someone tell me if it's possible to insert javascript code as an element's attribute's value? That is, I create a select element; I also create some option elements, appending each one as a child to the select element as I create them. To the select element, I add an attribute called "onchange", and it's value is: "alert('option changed')"; that is, I do: var e = document.createElement("select"); e.setAttribute("onchange", "alert('option changed')"); I bring up the page on my browser, I do see the pulldown, but when I change the option, I don't get the javascript alert like I expect to. Am I doing this correctly? If not how can I do this? Thanks! -alex __________________________________________________ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.comReceived on Thursday, 6 December 2001 12:54:38 GMT
This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:55 GMT