在Javascript中onclick()方法应用

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

原文地址:https://www.cnblogs.com/yangwujun/p/5680043.html