[英]Javascript, submit button not calling function in HTML5 page
这是一个家庭作业...页面肯定是不完整的,但我仍然可以用提交按钮调用我的功能,对吗?
我一直收到错误,找不到文件,或者表单不会处理。
<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
<script type="text/javascript">
function f1(){
document.writeln("Hello");
};
</script>
</head>
<body>
<form>
Customer Name: <input type = "text" id = "cusName"/>
</p>
Delivery Date: <input type = "text" id="delDate"/>
</p>
Number of items: <input type = "text" id = "numItem"/>
</p>
<button onlick="f1();return false">Submit</button>
</form>
</body>
</html>
在您的按钮中有一个输入错误,您键入“ onlick
”而不是onClick
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.