JavaScript中访问Html的select表单域的values值简单问题(50分)

  • 主题发起人 sharkHun
  • 开始时间
S

sharkHun

Unregistered / Unconfirmed
GUEST, unregistred user!
<html>
<head>
<title>
</title>
<script language='javascript'>
function clickit()
{
//能访问到select表单域的text值
var strTmp1= frmTest.ListRegion.options(frmTest.ListRegion.selectedIndex).text;
//不能访问到select表单域的value值,why?
var strTmp2= frmTest.ListRegion.options(frmTest.ListRegion.selectedIndex).value;
do
cument.body.insertAdjacentHTML('Afterbegin
', 'Text='+strTmp1+'value='+strTmp2);
}
</script>
</head>
<body>
<form name='frmTest' >
<select size='1' name='ListRegion' ID='ListRegion'>
</option><option Values='001'>长宁路</option>
<option Values='002'>定西路</option>
<option Values='003'>凯旋路</option>
</select>
</form>
 
<select size='1' name='ListRegion' ID='ListRegion'>
</option><option Values='001'>长宁路</option>
<option [red]Values[/red]='002'>定西路</option>
<option Values='003'>凯旋路</option>
</select>
多了个s
 
不好意思!!!
 
接受答案了.
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
542
import
I
I
回复
0
查看
731
import
I
顶部