?? department.js
字號:
function add()
{
var index = document.all.select1.selectedIndex;
if(index!=-1)
{
var value = document.all.select1.options[index].value;
var item = document.all.select1.options[index].text;
//檢查是否有重復的
var bool = 0;
for(var i=0;i<document.all.select2.length;i++)
{
if(document.all.select2.options[i].value==value)
{
bool = 1;
break;
}
}
//添加
if(bool==0)
{
var oOption = document.createElement("OPTION");
document.all.select2.options.add(oOption);
oOption.innerText = item;
oOption.value = value;
}
}
}
function del()
{
var index = document.all.select2.selectedIndex;
if(index==-1)return;
document.all.select2.options.remove(index);
}
function addall()
{
//清空已選列表
var length = document.all.select2.length;
for(var i=0;i<length;i++)
{
document.all.select2.options.remove(0);
}
//添加全部列表
for(var i=0;i<document.all.select1.length;i++)
{
var item = document.all.select1.options[i].text;
var value = document.all.select1.options[i].value;
var oOption = document.createElement("OPTION");
document.all.select2.options.add(oOption);
oOption.innerText = item;
oOption.value = value;
}
}
function delall()
{
var length = document.all.select2.length;
for(var i=0;i<length;i++)
{
document.all.select2.options.remove(0);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -