标签:str select2 其他 click func hang set 3.0 button
4.0 version
1、$(‘#yourButton‘).on(‘click‘, function() { $(‘#yourfirstSelect2‘).val(null).trigger("change"); $(‘#yourSecondSelect2‘).val(null).trigger("change"); .... });
2、$(‘#yourButton‘).on(‘click‘, function() { $(‘#yourfirstSelect2‘).select2(‘val‘,‘all‘); $(‘#yourSecondSelect2‘)
.select2(‘val‘,‘all‘);
.... });
3.0 version
$(‘#yourButton‘).on(‘click‘, function() { $(‘#yourfirstSelect2‘).select2("val", ""); $(‘#yourSecondSelect2‘).select2("val", ""); .... });
ie/google经测试均可用,其他未测试
clear/reset select2,重置select2,恢复默认
标签:str select2 其他 click func hang set 3.0 button
原文地址:http://www.cnblogs.com/zwakeup/p/7985619.html