How to call javascript from a href?

<a onClick="yourFunction(); return false;" href="https://stackoverflow.com/questions/16337937/fallback.html">One Way</a>

** Edit **
From the flurry of comments, I’m sharing the resources given/found.

Previous SO Q and A’s:

  • Do you ever need to specify ‘javascript:’ in an onclick? (and the IE related A’s following)
  • javascript function in href vs onclick

Interesting reads:

  • http://crisp.tweakblogs.net/blog/the-useless-javascript-pseudo-protocol.html
  • https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Statements/label

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)