<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>函数调用</title> <script type="text/javascript"> function contxt() //定义函数 { alert("哈哈,调用函数了!"); } </script> </head> <body> <form> <input type="button" value="点击我" onclick="contxt ()"/> </form> </body> </html>
运行了之后没问题,但是它不让我通过,是不是哪里写得不标准?
onclick
=
"contxt ()" 中间多个空格
<
input
type
=
"button"
value
=
"点击我"
onclick
=
"contxt ()"
/>
后面的/去掉