I want to prevent a select box from being changed if a certain condition applies. Doing this doesn\'t seem to work:
$(\'#my_select\').bind(\'change\', funct
This worked for me, no need to keep a lastSelected if you know the optionIndex to select.
lastSelected
optionIndex
var optionIndex = ... $(this)[0].options[optionIndex].selected = true;