JavaScript HREF
You probably need a button, not a link.
Never use "javascript:" "#" or similar as the value of an href attribute.
The purpose of the href attribute is to specify a URL only. If you wish to run JavaScript on an element click, use a button instead.
Bad
Good
Even better
Use progressive enhancement:
The screen reader will announce "Share on Facebook. Button" or fallback to "Share on Facebook. Link" if JavaScript is not ready or available.
Last updated