如何 select 选择 jquery 中的所有项目
How to select all items in jquery chosen
如何 select 选择 jquery 中的所有项目 我知道
$('.my-select-all').click(function(){
$('#my_select option').prop('selected', true); // Selects all options
});
但我只需要 select 搜索结果。谢谢
我找到了 2 个答案
1. http://robido.com/jquery/add-selectdeselect-optgroup-click-events-harvests-chosen-jquery-plugin/
- How do I select all options in a jQuery Chosen multi-select AFTER search filtering?
如何 select 选择 jquery 中的所有项目 我知道
$('.my-select-all').click(function(){
$('#my_select option').prop('selected', true); // Selects all options
});
但我只需要 select 搜索结果。谢谢
我找到了 2 个答案 1. http://robido.com/jquery/add-selectdeselect-optgroup-click-events-harvests-chosen-jquery-plugin/
- How do I select all options in a jQuery Chosen multi-select AFTER search filtering?