我想用js取一个input的值,死活取不出,大家帮忙看看哪里出了问题

<html><head></head><bodyonbeforeunload="ClearSession()"><inputname="TextBox1"type="te... <html>
<head></head>
<body onbeforeunload="ClearSession()">
<input name= "TextBox1" type= "text " id= "TextBox1" value= "ok " /> <br />
</body>
<script>
function ClearSession()
{
alert(document.getElementById("TextBox1").Value);
}
</script>
</html>
展开
 我来答
武汉小朱
2011-04-01 · TA获得超过2762个赞
知道小有建树答主
回答量:1212
采纳率:50%
帮助的人:913万
展开全部
alert(document.getElementById("TextBox1").Value);
应该这么写。
alert(document.getElementById("TextBox1").value);
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式