經安全檢測,此網站為安全網站,請放心前往原始網址!

JavaScript function in href vs. onclick - Stack Overflow

I want to run a simple JavaScript function on a click without any redirection. Is there any difference or benefit between putting the JavaScript call in the href attribute (like this:

stackoverflow.com

網址安全性掃描由 google 提供