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

posted @ 2016-07-18 09:07  哪啊哪啊神去村  阅读(2664)  评论(0编辑  收藏  举报