js方法取名的问题

来源:互联网 发布:mac apache ant 安装 编辑:程序博客网 时间:2024/05/02 02:05
<html><head></head><body ><button type="button" id="testButton" onclick="click()" >click me!</button></body><script type="text/javascript">function click(){ alert(1); }</script></html>

这段代码不能运行,调试了我好久 ! 发现onclick事件函数写"click()"就是不行呀!换个方法名就好了 有没有!坑爹呀