I am trying to do some functionality in onClick()
event and also doing the href
for the same element. But actually happening is its not triggering onClick()
completely and its moving to href
link when we click that element.
How to make onClick()
gets complete first and trigger href
next.
<a href="" onclick="javascript:triggerMe()">click</a>
As I understood, you don't want to go on other page, so use return false, like this:
<a href="" onclick="javascript:triggerMe();return false;">click</a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With