请问javascript能实现如下功能吗?如果可以请给出程序! selectName.options[selectName.options.length]=new Option("V","T",true,true) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><script language="JavaScript"><!--function addSrcToDestList() {destList = window.document.forms[0].destList;srcList = window.document.forms[0].srcList;var len = destList.length;for(var i = 0; i < srcList.length; i++) {if ((srcList.options[i] != null) && (srcList.options[i].selected)) {var found = false;for(var count = 0; count < len; count++) {if (destList.options[count] != null) {if (srcList.options[i].text == destList.options[count].text) {found = true;break; } }}if (found != true) {destList.options[len] = new Option(srcList.options[i].text);len++; } } }}function deleteFromDestList() {var destList = window.document.forms[0].destList;var len = destList.options.length;for(var i = (len-1); i >= 0; i--) {if ((destList.options[i] != null) && (destList.options[i].selected == true)) {destList.options[i] = null; } }}// --></SCRIPT></head><body><center><form method="POST"><table bgcolor="#FFFFCC"><tr><td bgcolor="#FFFFCC" width="85"><select size="6" name="srcList" multiple><option value="1">Item 1<option value="2">Item 2<option value="3">Item 3<option value="4">Item 4<option value="5">Item 5<option value="6">Item 6</select></td><td bgcolor="#FFFFCC" width="74" align="center"><input type="button" value=" 增加到右边 " onClick="javascript:addSrcToDestList()"><br><br><input type="button" value=" 从右边删除 " onclick="javascript:deleteFromDestList();"></td><td bgcolor="#FFFFCC" width="69"><select size="6" name="destList" multiple></select></td></tr></table></form></body></html> 感谢net_lover(孟子E章)!放心,分数已经是你的了.我想再多问一句,我如何为新添加的表项添加双击事件呢? 求注释: "立即登录"按钮对应的脚本程序是啥? 我的愿望很简单 就是php返回一个json数据到jquery 三天了 为什么没人帮我啊 javascript能不能取得ActiveX控件的版本号? 用javascript怎样实现这一结果??? 恳求大家帮我一下吧,这个怎么替换? 请问如何在网页上做一个最小化窗口的按钮? 一个小问题,请看看.... 请问哪里有HTMLREF.CHM中文版下载,最好版本要新一点的 dwz查找带回问题 请问怎样通过单击一按钮实现多个文本框的属性由原来的readonly 改为非readonly 急!!如何取得本地图片的宽度和高度?
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
<!--
function addSrcToDestList() {
destList = window.document.forms[0].destList;
srcList = window.document.forms[0].srcList;
var len = destList.length;
for(var i = 0; i < srcList.length; i++) {
if ((srcList.options[i] != null) && (srcList.options[i].selected)) {var found = false;
for(var count = 0; count < len; count++) {
if (destList.options[count] != null) {
if (srcList.options[i].text == destList.options[count].text) {
found = true;
break;
}
}
}
if (found != true) {
destList.options[len] = new Option(srcList.options[i].text);
len++;
}
}
}
}function deleteFromDestList() {
var destList = window.document.forms[0].destList;
var len = destList.options.length;
for(var i = (len-1); i >= 0; i--) {
if ((destList.options[i] != null) && (destList.options[i].selected == true)) {
destList.options[i] = null;
}
}
}
// -->
</SCRIPT>
</head>
<body>
<center>
<form method="POST">
<table bgcolor="#FFFFCC"><tr>
<td bgcolor="#FFFFCC" width="85">
<select size="6" name="srcList" multiple>
<option value="1">Item 1
<option value="2">Item 2
<option value="3">Item 3
<option value="4">Item 4
<option value="5">Item 5
<option value="6">Item 6
</select>
</td>
<td bgcolor="#FFFFCC" width="74" align="center">
<input type="button" value=" 增加到右边 " onClick="javascript:addSrcToDestList()">
<br><br>
<input type="button" value=" 从右边删除 " onclick="javascript:deleteFromDestList();">
</td>
<td bgcolor="#FFFFCC" width="69">
<select size="6" name="destList" multiple>
</select>
</td>
</tr>
</table>
</form>
</body>
</html>
放心,分数已经是你的了.我想再多问一句,我如何为新添加的表项添加双击事件呢?