select类
/*
添加一项
参数:
oid:select对象名称
*/
function CSelect(oid)
{
this.obj = document.getElementById(oid);
this.add = Add;
this.clear = Clear;
this.selectItem = SelectItem;
}
/*
添加一项
参数:
n:option名
n:option值
*/
function Add(n,v)
{
var item = document.createElement("OPTION");
this.obj.options.add(item);
item.innerText = n;
item.value = v;
}
/*
清空所有option项
*/
function Clear()
{
this.obj.options.length = 0;
}
/*
选择某项
*/
function SelectItem(s)
{
this.obj.selectedIndex = s;
}


浙公网安备 33010602011771号