Please read carefully the title - this is not the common onchange thing.
There exists a selectbox on a webpage. The selectbox its selectedIndex can be changed programmatically by javascript, external js.
I would like to be notified when the index changes (crossbrowser solution). Is this possible?
Or HTML:
<select id="mySelect">
<option>opt 1</option>
<option>opt 2</option>
<option>opt 3</option>
</select>
JavaScript:
// Code I cannot manipulate
var select = document.getElementById("mySelect");
select.selectedIndex = 2; // I would like to be notified now
Awaiting your insights :-)
Update:
This doesn't answer my original question, but using this I managed to accomplish what I initially wanted (not part of the post):
select.selectedIndex = 2;
select.onchange();