JavaScript in links Mar08 '06
I hate having to do this:
<a href="#" ... >
I also hate doing this:
<a href="javascript:void(0)" ... >
So... as a "best practice," what is the best way to disable a link’s normal activity, on click?
I’ve toyed with leaving out the href attribute out, altogether, but I don’t know if that would validate.
Categories: JavaScript ![]()
Add Feedback (view all)
Leave feedback
Uhh, it ate my code. a href="version for people without javascript or search engines" onclick="doStuff(); return false;" obviously wr ... Read more.
matthom
is published and produced by Matt Thommes - an independent publishing enthusiast, mobile blogger, content creator, informative writer, web developer from Chicago.
Never one to conform, Matt intends to promote the effect the web has on our lives, in an effort to intensify, instruct, and clarify all that is happening around us.
Similar Entries
- Internal links: relative vs. absolute (40 recent visits)
- Hidden Flickr links and functionality (106 recent visits)
- Using affiliate links: good or bad? (10 recent visits)
- Printing links; summaries (4 recent visits)
- ETech notes/links (3 recent visits)
- Links: 07/07/2004 (4 recent visits)
Stats
0 unique visits since Mar08 '06
... Read more.