点击左边的列表框里面的选项,自动选入右边列表框,还支持删除功能,实用列表框内容选择特效。
<html> <head> <meta http-equiv="content-Type" content="text/html;charset=utf-8"> <meta name="keywords" content="武鸣人网站,武鸣信息网,武鸣本地网,武鸣信息资源平台,减肥,健身,励志,励志语录,js特效,网页特效,www.wuming.ren"> <meta name="description" content="欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。"> <title>点击左右列表框内容互换效果_武鸣人</title> </head> <body> <a href="https://www.wuming.ren">武鸣人</a>,各种信息资源免费发布,分享励志语录经典短句,减肥健身常识,各种js特效代码。网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)<hr> <!--欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。--> <script type="text/javascript" src="https://www.wuming.ren/ad/tc.js"></script> <script type="text/javascript" src="https://www.wuming.ren/ad/a.js"></script> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function moveOver() { var boxLength = document.choiceForm.www_wuming_ren.length; var selectedItem = document.choiceForm.wuming_ren.selectedIndex; var selectedText = document.choiceForm.wuming_ren.options[selectedItem].text; var selectedValue = document.choiceForm.wuming_ren.options[selectedItem].value; var i; var isNew = true; if (boxLength != 0) { for (i = 0; i < boxLength; i++) { thisitem = document.choiceForm.www_wuming_ren.options[i].text; if (thisitem == selectedText) { isNew = false; break; }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) } } if (isNew) { newoption = new Option(selectedText, selectedValue, false, false); document.choiceForm.www_wuming_ren.options[boxLength] = newoption; } document.choiceForm.wuming_ren.selectedIndex=-1; }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) function removeMe() { var boxLength = document.choiceForm.www_wuming_ren.length; arrSelected = new Array(); var count = 0; for (i = 0; i < boxLength; i++) { if (document.choiceForm.www_wuming_ren.options[i].selected) { arrSelected[count] = document.choiceForm.www_wuming_ren.options[i].value; } count++; }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) var x; for (i = 0; i < boxLength; i++) { for (x = 0; x < arrSelected.length; x++) { if (document.choiceForm.www_wuming_ren.options[i].value == arrSelected[x]) { document.choiceForm.www_wuming_ren.options[i] = null; } }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) boxLength = document.choiceForm.www_wuming_ren.length; } } function saveMe() { var strValues = ""; var boxLength = document.choiceForm.www_wuming_ren.length; var count = 0; if (boxLength != 0) { for (i = 0; i < boxLength; i++) { if (count == 0) { strValues = document.choiceForm.www_wuming_ren.options[i].value; }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) else { strValues = strValues + "," + document.choiceForm.www_wuming_ren.options[i].value; } count++; } } if (strValues.length == 0) { alert("您没有选择任何内容"); } else { alert("您选择的内容如下:\r\n"+"第" + strValues+"条"); } }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) // End --> </script> <form name="choiceForm"> <table border=0> <tr> <td valign="top" width=175> <div align="center">可选内容:<br> <select name="wuming_ren" size=10 onchange="moveOver();"> <option value="1">武鸣人一号</option> <option value="2">武鸣人二号</option> <option value="3">武鸣人三号</option> <option value="4">武鸣人四号</option> <option value="5">武鸣人五号</option> <option value="6">武鸣人六号</option> <option value="7">武鸣人七号</option> <option value="8">武鸣人八号</option> <option value="9">武鸣人九号</option> <option value="10">武鸣人十号</option> </select> </div> </td> <td valign="top"> <div align="center">你的选择:<br> <select multiple name="www_wuming_ren" style="width:150;" size="10"> </select> </div> </td> </tr> <tr> <td colspan=2 height=10> <div align="center"> <input type="button" value="删除" onclick="removeMe();"> <input type="button" value="结果" onclick="saveMe();"> </div> </td> </tr> </table> </form> </body> </html>
本文来自武鸣人网站,转载请注明出处