Hacker News new | past | comments | ask | show | jobs | submit login

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Back then, you'd use it with the `href` attribute to prevent the link from going anywhere (it would return `undefined`), then call a function with the `onclick` attribute.

E.g.

  <a href="javascript:void(0)" onclick="clickHandler()">Click me</a>



Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: