Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the deselected value with Chosen

I am using Chosen jQuery plugin, and I have successfully installed it. now I want to get the selected or deselected items, here is the docs:

http://harvesthq.github.io/chosen/options.html

It says on change trigger, it sends select and deselect as parameters, how could I access to those?

for example:

$('#days').on('change', function(evt, params) {
    // alert selected val if the users selected new item
    // alert deselected val if the users deselected item
}

Thanks

like image 678
behz4d Avatar asked Oct 28 '13 21:10

behz4d


People also ask

What is chosen in JQuery?

Chosen is a JavaScript plugin that makes long, unwieldy select boxes much more user-friendly. It is currently available in both jQuery and Prototype flavors.


1 Answers

$('#days').on('change', function(evt, params) { // can now use params.selected and params.deselected }

like image 136
learner Avatar answered Sep 29 '22 16:09

learner