1.取value值
var xxlh = new String(document.Form1.XL.value);
2.取text值
var xxlm
try
{
xxlm = new String(document.Form1.XL.options[document.Form1.XL.selectedIndex].text);
}
catche(e)
{
alert('XL的text值可能未指定或XL未绑定');
}
3.按指定索引选择下拉列表
document.Form1.XL.selectedIndex = 0;
4.按索引移除下拉列表的某一项
document.Form1.XL.options.remove(document.Form1.XL.length-1);
5.为下拉列表添加一项
document.Form1.XL.options.add(new Option(text,value));
var xxlh = new String(document.Form1.XL.value);
2.取text值
var xxlm
try
{
xxlm = new String(document.Form1.XL.options[document.Form1.XL.selectedIndex].text);
}
catche(e)
{
alert('XL的text值可能未指定或XL未绑定');
}
3.按指定索引选择下拉列表
document.Form1.XL.selectedIndex = 0;
4.按索引移除下拉列表的某一项
document.Form1.XL.options.remove(document.Form1.XL.length-1);
5.为下拉列表添加一项
document.Form1.XL.options.add(new Option(text,value));