在Javascript中onclick()方法应用

来源:岁月联盟 编辑:exp 时间:2012-10-16

<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()时候会不弹出对话框信息。