javascript取不到文本框的值?
sghys 2005-08-20 01:19:53 javascript取不到文本框的值?
我的意思是当单击ok按钮时,应弹出3这个值
源代码如下:
<html>
<body>
<input type="text" name="tr" value=3 />
<input type="button" onclick="javascript:doValidTextValue()" value='ok'/>
</body>
</html>
<script language=javascript>
function doValidTextValue(){
var _page=document.getElementsByName("tr");
alert(_page.value);
}
</script>