I'm using UI Selectmenu in my project
UI selectmenu has a select option to set select behavior for all selectmenu options like :
$('.anything').
selectmenu({
select : function(event, options) {
spec_function('2')
}
});
How can I set a specific select behavior for each option or a specific option not all ?
Use switch-case statement and as SurjithSM says, send the ID of what option you're selecting. As such:
<script type="text/javascript">
$('.anything').
selectmenu({
select : function(event, options){
switch(options['value']) {
case 'some_value_1':
// anycode 1 ...
break;
case 'some_value_2':
// anycode 2 ...
break;
case 'some_value_3':
// anycode 3 ...
break;
default:
// default anycode ...
break;
}
}
});
</script>