Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
11
rated 0 times [  15] [ 4]  / answers: 1 / hits: 54642  / 11 Years ago, thu, december 19, 2013, 12:00:00

I can see a lot of <a href=javascript:void(0);> on html pages. From I've read it does nothing by returning undefined. How is this different with <href=#>


More From » javascript

 Answers
4
<a href=#>link</a>


adds # to the browser url and jumps to the top of the page.



<a href=javascript:void(0);>link</a>


simply ignores the link click.



<a href=# onclick=return false;>link</a>


also ignores the href.



Don't forget that in some cases javascript might be disabled (very uncommon).


[#73660] Tuesday, December 17, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
taylert

Total Points: 627
Total Questions: 91
Total Answers: 108

Location: Mayotte
Member since Mon, Sep 12, 2022
2 Years ago
taylert questions
;