让超链接指向js函数

<a href="#" onclick="javascript:fun();return false;"/>

“return false”这句话很关键,它保证点了链接之后不会跳转到别处

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.