javascript获取Select当前值
2015-03-18来源:

javascript获取Select当前值,具体代码如下:

function GetObjID(ObjName)

{

for (var ObjID=0; ObjID < window.frm2.elements.length; ObjID++)

if ( window.frm2.elements[ObjID].name == ObjName )

{

return(ObjID);

break;

}

return(-1);

}

function select1Get(ObjName)

{

select1id = GetObjID(ObjName);

for (i=window.frm2.elements[select1id].length-1; i>=0; i--)

{

if (window.frm2.elements[select1id].options[i].selected)

{

select1Value = window.frm2.elements[select1id].options[i].text;

}

}

}

更多信息请查看IT技术专栏

推荐信息
Baidu
map