How to use a link to call JavaScript?

<a onclick="jsfunction()" href="#">

or

<a onclick="jsfunction()" href="https://stackoverflow.com/questions/688196/javascript:void(0);">

Edit:

The above response is really not a good solution, having learned a lot about JS since I initially posted. See EndangeredMassa’s answer below for the better approach to solving this problem.

Leave a Comment

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