日期:2014-05-16 浏览次数:20427 次
<SCRIPT LANGUAGE="JavaScript"> <!-- //(2)将所有相同的option内容去掉 function test(){ var array=["1","2","2","3","cc","cc"]; var data={}; var desiredArr=new Array(); for(var i=0;i<array.length;i++){ data[array[i]]=array[i]; } for(var pro in data){ desiredArr.push(data[pro]); } for(var tt in desiredArr){ alert(desiredArr[tt]); } } test(); //--> </SCRIPT>
?