I am using jquery multiselect widget. I would like to uncheck all if all them were checked manually. I have a sample code in
JSFiddle–> Code
This doesn’t work. When the select options are selected manually, check for no of unchecked options in select it gives me 1 (at the click of last option) the first time. so I checked if $this.children("option").not('[selected]').length is 1 and ui.checked and calling the uncheckAll
but after that it is behaving properly the code
if $this.children("option").not('[selected]').length gives me 0 when selecting the final one.
I am wondering what is happening.
well so here is the solution what you want… check the documentation , there is method
getCheckedto getselected options. yours is not working because the pluging reformat the select elements.fiddle example : http://jsfiddle.net/fG6PT/11/