Reputation: 26565
when I click:
<a href="#" onclick="plus();">+ 1 </a>
then in the address bar appears '#' in addition to URL ( example.com/index.php?id=1# ).
Is there a way to avoid that ?
Upvotes: 2
Views: 81
Reputation: 81
use preventDefault(); instead of return false.
for the reasons explained here. http://fuelyourcoding.com/jquery-events-stop-misusing-return-false/
Upvotes: 1
Reputation: 145428
You can add return false
. It will prevent the default action.
<a href="#" onclick="plus(); return false;">+ 1</a>
Upvotes: 6