Skip to content

Instantly share code, notes, and snippets.

@delirehberi
Created October 18, 2015 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save delirehberi/5f69b7c3391353028168 to your computer and use it in GitHub Desktop.
Save delirehberi/5f69b7c3391353028168 to your computer and use it in GitHub Desktop.
Bootstrapped selection remove for multiple selectbox.
$("select[multiple]").each(function () {
$(this).parents('.form-group').append('<a href=# class="remove-selection"><i class="entypo-cancel"></i></a>')
});
$(document).on('click','.remove-selection',function(){
$(this).parents('.form-group').find('select').find('option:selected').each(function(i,o){
o.selected = false;
});
return false;
})
@ismailbaskin
Copy link

$(this).parents('.form-group').find('select').value = []

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment