That looks OK but, I would have done this:
Code:
dropBox.onchange=function(){
any valid code here
}
or:
Code:
var someFunction=function(){
alert('Hi');
}
dropBox.onchange=someFunction;
The setAttribute() method might work for this but, the syntax may be different than you expect. If I were to try using it in this regard, I would try:
dropBox.setAttribute ('onchange', 'alert("Hi")', 0)
But, that works in FF, not IE (just tested it). The setAttribute() method isn't always well supported for all attributes in IE.
Bookmarks