My web application uses a lot of Perform client script action anchor links which are used for scripting (a habit I picked-up from
stands for anchorIf you include the [href] attribute on an element, it is an anchor that points to a location, which means that you could go to a new page, a particular fragment of the current page (hence the # being called the fragment identifier), or a particular fragment of a new page.
elements without an [href] attribute were historically assigned a [name] attribute, which could be used as the destination of the fragment identifier. Browsers later added support for linking to any item's [id] attribute, and this is now the preferred method for linking to a document fragment.
elements?An a[href] element is a link (which is why they are matched with :link in css). links are clickable. An a element without the [href] attribute is otherwise just a placeholder for where a link might otherwise have been placed, and not clickable, nor are they in the tabbing order of the page.
If you want your links to be keyboard navigable which is important for accessibility (WAI-ARIA), you'll need to do one of the following:
[href] attribute[tabindex="0"] and one of [role="button"] or [role="link"] (and possibly some styling)More information about the [role] attribute can be found in the Roles Model section of the WAI-ARIA docs.
If you don't have a reason to keep the [href] attribute, you might as well be using a element:
The [type] attribute is used to make the element a generic button, otherwise will default to [type="submit"], which may not be desirable as it could trigger form submission.
If you can't use a You'll need to listen for If you're keeping the E.x. If you need to provide support for users with JS disabled, you might as well direct them to a page that performs equivalent functionality without JS. By extension, this also includes providing document fragment links to link to the content within the same document. For example, a toggleable region may be marked up as: So that with JS the region can be collapsed and expanded, and without JS the link will take the user to the appropriate content on the page. E.x. If you're preventing the default behavior behind-the-scenes in JavaScript, and you're not supporting users with JS disabled, you can use a "dud" href value to keep the link in the tabbing order and automatically enable Enter to trigger the (usually occurs when the inner markup must contain a using:
keypress events and trigger click events for Enter and Space.Keeping the markup
element and its [href] attribute, there are a number of options for its value.A real link
Read More
A dud href
click event. You should add [role="button"] as semantically the tag is no longer being used as a link, but as a button.Some clickable text