js操作listbox
来源:互联网 发布:d3.js v4 tree 编辑:程序博客网 时间:2024/04/29 17:30
选择人员或者部门或其他时,经常会用到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]);
}
}
- js操作listbox
- js操作listbox
- js操作listbox
- js操js操作listbox
- JS listBox
- js操作ListBox实现多项的添加和删除
- js中的listbox
- js移动listbox内容
- javascript操作listbox方法
- listbox实现拖放操作
- listbox相关操作
- vc中的listbox操作
- javascript 操作 listbox
- ListBox的操作
- vc中的listbox操作 .
- javascript操作listbox示例
- javascript操作listbox方法
- JS ListBox动态加载数据
- flex 瘦身
- 金山雷军的故事
- 网页中的png图片无法显示
- linux-2.6.18内核移植及根文件系统的制做(简易)
- 新手
- js操作listbox
- Asp.net RBAC membership
- Enter提交在火狐里面失效的问题
- linux 2.6.10下添加yaffs2文件系统
- 手机贴膜选购及洗涤经验
- SQL AnyWhere下载地址
- 几个好用的网络电视
- SMS编程代码
- Linux 2.6.20 根文件系统的构建(RedHat 9)