添加删除select中的option元素
来源:互联网 发布:章鱼直播软件下载 编辑:程序博客网 时间:2024/05/16 17:10
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript" >...
function moveOpR()...{
var os=document.getElementById("s");
var os2=document.getElementById("s2");
if(os.options.length>=1)...{
var txt=os.options[os.options.selectedIndex].text;
var val=os.options[os.options.selectedIndex].value;
var op=new Option(txt,val,true,true);
os2.options.add(op);
os.remove(os.options.selectedIndex);
}
}
function moveOpL()...{
var os=document.getElementById("s");
var os2=document.getElementById("s2");
if(os2.options.length>=1)...{
var txt=os2.options[os2.options.selectedIndex].text;
var val=os2.options[os2.options.selectedIndex].value;
var op=new Option(txt,val,true,true);
os.options.add(op);//[os2.options.length]=op;
os2.remove(os2.options.selectedIndex);
}
}
</script>
</head>
<body >
<select name="s" size="4" id="s" ondblclick="moveOpR()" >
<option>1 </option>
<option>2 </option>
<option>3 </option>
<option>4 </option>
<option>5 </option>
<option>6 </option>
</select>
<select name="s2" size="4" id="s2" ondblclick="moveOpL()">
<option>7 </option>
<option>8 </option>
<option>9 </option>
<option>10 </option>
<option>11 </option>
<option>12 </option>
</select>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript" >...
function moveOpR()...{
var os=document.getElementById("s");
var os2=document.getElementById("s2");
if(os.options.length>=1)...{
var txt=os.options[os.options.selectedIndex].text;
var val=os.options[os.options.selectedIndex].value;
var op=new Option(txt,val,true,true);
os2.options.add(op);
os.remove(os.options.selectedIndex);
}
}
function moveOpL()...{
var os=document.getElementById("s");
var os2=document.getElementById("s2");
if(os2.options.length>=1)...{
var txt=os2.options[os2.options.selectedIndex].text;
var val=os2.options[os2.options.selectedIndex].value;
var op=new Option(txt,val,true,true);
os.options.add(op);//[os2.options.length]=op;
os2.remove(os2.options.selectedIndex);
}
}
</script>
</head>
<body >
<select name="s" size="4" id="s" ondblclick="moveOpR()" >
<option>1 </option>
<option>2 </option>
<option>3 </option>
<option>4 </option>
<option>5 </option>
<option>6 </option>
</select>
<select name="s2" size="4" id="s2" ondblclick="moveOpL()">
<option>7 </option>
<option>8 </option>
<option>9 </option>
<option>10 </option>
<option>11 </option>
<option>12 </option>
</select>
</body>
</html>
- 添加删除select中的option元素
- select中添加、修改、删除option元素
- select中添加、修改、删除option元素
- select中添加、修改、删除option元素
- select中添加、删除option
- js select option添加/删除
- JS动态添加与删除select中的Option对象
- 删除select元素里面的所有option
- JQuery动态添加Select的Option元素
- JS select option 元素的大批量添加
- JQuery动态添加Select的Option元素
- Select下拉列表框(添加、删除option)
- Select下拉列表框(添加、删除option)
- js 两个 multiple select 添加 删除 option
- jQuery添加/删除Select的Option项
- 关于如何删除掉select中的option元素,兼容IE、Firefox
- 关于如何删除掉select中的option元素,兼容IE、fireFox
- 动态添加SELECT标签中的元素,数据项与option数据源不一致
- 无限分类~~就这么简单!
- 一个日历输入空间的程序,我改的,加上了小时、分钟的输入
- RUP
- Oracle 的十八般武艺 (转载)
- Linux常用命令简介
- 添加删除select中的option元素
- JDK版本不兼容(Unsupported major.minor version 49.0)
- 在程序里修改配置文件
- JNI编程注意事项
- 断点继传
- Microsoft Asp.net Ajax 框架介绍
- [转]2007男人感悟29条
- 正则
- no title and no keyword