举一个例子说明吧:
<a href="next.htm" check()">Open</a>
只有当check函数返回true是,才会执行默认操作,打开next.html,返回false是,不会执行打开next.html页面这个默认操作。
而<a href="next.htm" onclick="check()">Open</a>
不管check函数返回的是true 或者false 都会执行打开next.html这个页面