标签:
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());
JavaScript 字符串与数组互转,并保持数据去重、排序功能
标签:
原文地址:http://www.cnblogs.com/rgqancy/p/5610249.html