I have this code
var option = new Option(thatOption.text, thatOption.value);
$(option).click( function(){
//Sorry cannot reveal what is here I'll just use this so that it can be referenced
alert("clicked");
}
);
try{
selectBox.add(option,null);
}catch(e){
// Stupid IE doesn't know how to follow the spec
selectBox.add(option);
}
This code works in FF > 2 (don't have FF 1 oe FF 2 to test), Opera (presto), Chrome (webkit) and doesn't work on IE.
When I click the option in the selectbox nothing happens. No event seems to be launched simply, nothing!
Question. How can I solve that?
Objective: (according to that code) make the alert appear
BTW: Why does that happen?
Extra note: The developer tools state that there are no errors involved.