Javascript,提交按钮不在HTML5页面中调用功能

时间:2017-01-20 19:08:10

标签: javascript html5

这是一个家庭作业...页面肯定是不完整的,但我仍然可以用提交按钮调用我的功能,对吗?

我一直收到无法找到文件的错误,或者表单无法处理。

<!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> 

1 个答案:

答案 0 :(得分:3)

您输入“onlick”而不是onClick

的按钮中有拼写错误