[英]What's wrong with my textbox html code?
Here is the code: 这是代码:
<html>
<head>
<title> Welcome Page </title>
</head>
<body>
<h1>Greetings</h1>
<p>
Enter your name: <input type=“text” id=“nameBox” size=12 value="">
</p>
<input type="button" value="Click for Greeting"
onclick="document.getElementById('outputDiv').innerHTML='hello' + document.getElementById('nameBox').value + ', welcome to my page.<br>Do you mind if I call you' + document.getElementById('nameBox').value + '?';">
<hr>
<div id=“outputDiv”></div>
</body>
All I'm getting is an error in line 13: Uncaught TypeError: Cannot read property 'value' of null. 我所得到的只是第13行中的错误:未捕获的TypeError:无法读取null的属性“值”。
I'm new to this, so help would be very much appreciated! 我对此并不陌生,因此非常感谢您的帮助! Thanks.
谢谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.