javascript操作listbox方法
来源:互联网 发布:cfd软件有哪些 编辑:程序博客网 时间:2024/05/15 13:24
选择人员或者部门或其他时,经常会用到2个listbox,下面这js代码,希望能给大家以及自己带来方便
function SelectAll()
{
var lst1=window.document.getElementById("SourceListBox");
var length = lst1.options.length;
for(var i=0;i<length;i++)
{
var v = lst1.options[i].value;
var t = lst1.options[i].text;
var lst2=window.document.getElementById("DestinationListBox");
lst2.options[i] = new Option(t,v,true,true);
}
}
function DelAll()
{
var lst2=window.document.getElementById("DestinationListBox");
var length = lst2.options.length;
for(var i=length;i>0;i--)
{
lst2.options[i-1].parentNode.removeChild(lst2.options[i-1]);
}
}
function SelectOne()
{
var lst1=window.document.getElementById("SourceListBox");
var lstindex=lst1.selectedIndex;
if(lstindex<0)
return;
var v = lst1.options[lstindex].value;
var t = lst1.options[lstindex].text;
var lst2=window.document.getElementById("DestinationListBox");
lst2.options[lst2.options.length] = new Option(t,v,true,true);
}
function DelOne()
{
var lst2=window.document.getElementById("DestinationListBox");
var lstindex=lst2.selectedIndex;
if(lstindex>=0)
{
var v = lst2.options[lstindex].value+";";
lst2.options[lstindex].parentNode.removeChild(lst2.options[lstindex]);
}
}
- javascript操作listbox方法
- javascript操作listbox方法
- javascript 操作 listbox
- javascript操作listbox示例
- javascript操作listbox,实现无刷新
- Javascript控制Listbox左右/上下移动方法集合
- Javascript 操作 ListBox或者Select(从Select1添加到Select2操作及逆操作)
- JavaScript ListBox Control
- javascript 对listbox 排序
- listbox实现拖放操作
- js操作listbox
- js操作listbox
- listbox相关操作
- vc中的listbox操作
- js操作listbox
- ListBox的操作
- vc中的listbox操作 .
- javascript操作json方法
- 计算Java日期
- Asp.Net细节性问题技巧精萃
- 提高 Java 代码的性能
- 在web下怎样用javascript向listbox中添加或删除所选定的项!
- Smartd
- javascript操作listbox方法
- [Oracle]高效的PL/SQL程序设计(一)--伪列ROWNUM使用技巧
- 释放C盘空间的27招优化技巧
- 落花人独立 微雨燕双飞
- 几个有用的Servlet过滤器
- JSP2.0中Simple Tag介绍
- 各种排序算法java实现
- asp.net面试题收集 你都会了吗
- rtexprvalue=true的含义