我想讓用戶把東西放到文本區域,輸出應該是他重寫x次的時間,但是我得到一個錯誤「document.forme is undefined」。爲什麼會給出「未定義」的錯誤?
你能幫我理解爲什麼它是未定義的嗎?
我的代碼:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>input home work</title>
<script type="text/javascript">
var help= document.forme.tryout.value;
for (x=1; x<=10;x++){
function numberCheak(){
document.write("this is"+" "+help++);
}
}
</script>
</head>
<body>
<form name="forme">
<input name="tryout" type="text" />
<input type="button" value="click me" onClick="numberCheak();"/>
</form>
</body>
</html>
而來的HTML表單這是功課?如果是這樣,鼓勵「家庭作業」標籤。 – harpo