jquery select2使用
初始化
$("#id").select2();
Change事件
$("#id").on("select2:select",function(){ var data = $(this).val(); });
获取值
//多选获取选中keys数组 单选获取值 $("#id").val(); //获取选中数组对象 $("#id").select2("data");
$("#id").select2();
$("#id").on("select2:select",function(){ var data = $(this).val(); });
//多选获取选中keys数组 单选获取值 $("#id").val(); //获取选中数组对象 $("#id").select2("data");