select下拉框之去掉重复
2016-03-15 11:17
323 查看
window.onload =function(){
select1();
select2();
}
function select1() {
var opts = document.getElementById('add_stdevice_code').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;
}
function select2() {
var opts = document.getElementById('add_stdevice_stcd').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;
}
select1();
select2();
}
function select1() {
var opts = document.getElementById('add_stdevice_code').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;
}
function select2() {
var opts = document.getElementById('add_stdevice_stcd').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;
}
相关文章推荐
- [转]【鹅厂网事】全局精确流量调度新思路-HttpDNS服务详解
- linux命令(5)文件操作:ls命令、显示文件总个数
- Js获取当前日期时间及其它操作
- PHP 二分查找
- #001 如何组织JS代码
- Linux命令之rmdir
- Js获取当前日期时间及其它操作
- 选择排序-直接选择排序
- oracle 导入DMP文件时IMP-00013: 只有 DBA 才能导入由其他 DBA 导出的文件
- Practical Rendering and Computation with Direct3D 11学习笔记(1.4)
- pthread_attr_t 控制线程属性结构体
- 基于数字图像处理的人民币碎片拼接
- frame中隐藏横向滚动条
- MapReduce: combiner
- 【数论】[codevs 2952 细胞分裂]快速幂
- 开始学习正则表达式
- 配置opencv
- String,StringBuffer与StringBuilder的区别??[转]
- C语言实现顺序表的所有操作代码
- 纪录一些很不错的文章