<script type="text/javascript">
window.onload = function() {
var opts = document.getElementById('sel').options;
var obj = new Object(), index = 0;
while (index < opts.length) {
if (opts[index].text in obj) opts[index] = null;
else {
obj[opts[index].text] = opts[index].text;
index++;
}
}
obj = null;
};
</script>
 
<select id="sel">
<option>11</option>
<option>11</option>
<option>22</option>
<option>22</option>
</select>
posted on 2017-11-15 15:59  FAIRY_TALE  阅读(561)  评论(1编辑  收藏  举报