
我想用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> 展开
<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> 展开
1个回答
展开全部
alert(document.getElementById("TextBox1").Value);
应该这么写。
alert(document.getElementById("TextBox1").value);
应该这么写。
alert(document.getElementById("TextBox1").value);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询