雷慕
2015-02-08 01:02
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>函数调用</title> <script type="text/javascript"> function context(){ alert("哈哈,调用函数了!"); } context(); </script> </head> <body> <form> <input type="button" value="点击我" onclick="context()" /> </form> </body> </html>
为什么这个代码提交失败呢?
其实很简单。。。题目你们都看走眼了
<!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 C要大写
JavaScript入门篇
739817 学习 · 9566 问题
相似问题