This question already has an answer here:
If you want an event or a link to an empty javascript call, there are several ways, of which I can think of:
<a href="#">Method 1</a> <- Ugh... changes URL in browser
<a href="javascript:;">Method 1</a> <- My currently preferred method
<a href="javascript:void(0);">Method 1</a> <- Another approach?
What is the best way in terms of cross-browser compatibility and shortness?
preventDefault()
or returns false,href="#"
doesn't change the browser URL. – Juhana Apr 15 '13 at 12:32a
tag around it for touch optimization. – bytecode77 Apr 15 '13 at 12:52