var valueArr = new Array(); if( $("input[name=‘type‘]").val() != ""){ valueArr = $("input[name=‘type‘]").val().split(","); } if(selectedValue != "" && $.inArray(selectedValue, valueArr) == -1){ valueArr.push(selectedValue); } $("input[name=‘type‘]").val(valueArr.sort().join());
时间: 2024-12-28 05:17:32