I am using the selectpicker
plugin of bootstrap
. Now i want to find which option is selected or deselected last.
<select class="selectpicker selection-criteria" multiple>
<option value="0" selected>Mustard</option>
<option value="1" selected>Ketchup</option>
<option value="2" selected>Relish</option>
</select>
Now i couldn't trigger any even in canJs
when any option
is selected
or deselected
. But i could trigger event on the whole picker.
".selection-criteria change": function(el,ev){
val colNames = $(el).val() // it returns all the selection options value
}
But can i trigger any event on the option click of the selectpicker
? When any option is changed then i will get that option and know that it is selected or deselected now?? Can i do that in canJs??
EDIT: If i select or deselect option 0 then i want to get that element i.e
<option value="0" selected>Mustard</option>
On the basis of whether it is selected now or deselected now, i will hide some divs.