<html>
<head>
<script type="text/javascript">
function onclick1(){
alert("Click button");
}
</script>
</head>
<body >
<input type="button" onClick="onclick1()" value="button"/>
</body>
</html>
当代码如下:
<html>
<head>
<script type="text/javascript">
function onclick(){
alert("Click button");
}
</script>
</head>
<body >
<input type="button" onClick="onclick()" value="button"/>
</body>
</html>
方法名字onclick()时候会不弹出对话框信息。

本文探讨了JavaScript中按钮点击事件的基本实现,通过实例展示了如何使用on专门的事件处理器来响应用户点击操作。
129

被折叠的 条评论
为什么被折叠?



