According to w3schools , the option tag supports the onclick attribute. I tried with the bottom of the trunk of IE6, and that doesn't seem to be the case.
The easiest way to do this:
<select multiple="multiple" onchange="alert(this.value);"> <option value="tx">Texas</option> <option value="ak">Alaska</option> <option value="ca">California</option> <option value="ws">Washington</option> <option value="tn">Tennessee</option> </select>
This is not exactly what you need, but should be pretty close.
edits
This will require more work:
<select multiple="multiple" onchange=" switch (this.value){ case 'tx': funcOne(); break; case 'ak': funcTwo(); break; etc... } "> <option value="tx">Texas</option> <option value="ak">Alaska</option> <option value="ca">California</option> <option value="ws">Washington</option> <option value="tn">Tennessee</option> </select>
At this point, it would be advisable to wrap onchange in a function in the js file instead of embedding it in html.
Mark
source share