
What is a Link? Definition A link is an interactive element that redirects the...
A <u>link</u> is an interactive element that redirects the user to a new location which can be another section inside the current page, modifying the URL with a <strong>#</strong> parameter, or a new page. It can be used to download a file. Once activated, it takes the user to the URL set in its href. The browser records that navigation in its history, so the user can return to the previous page using the back button.
The elements needs the attribute <u>href</u> with a valid <u>URL</u> or an <u>IDREF</u> pointing to a section inside the current page to have the semantic value of a link, otherwise it will be considered as generic.
<a href="/URL">
Go to main page
</a>
It can only be activated by pressing the key <u>Enter</u>. If the key Space is pressed while the focus is on the link, the page will scroll down.
Screen Readers, generally, announce the links in the following way: <strong>Link, [accessible name of the link]</strong>. It is extremely important to provide a descriptive and correct accessible name to the element.
It is completely unnaceptable, a bad practice and goes against the native behavior of the element, forcing it to behave as a button by doing the following:
<a href="javascript:void(0)" onclick="openModal()">
Open Menu
</a>
<a href="#" role="button" onclick="button()">
Link with role button
</a>
If you need to do this, it means that you need a link.
A <u>button</u> is an interactive element that dispatches an action inside the page where it is located. It does not redirect the user to another place or location nor modifies the url. The actions that are being dispatched can be: open a modal, play a video, post a comment, etc.
The button needs the attribute <u>type</u> with a value according to its action: - <strong>type="button"</strong>: it is used when the button does not have a default behavior. - <strong>type="submit"</strong>: it is used when the button sends information to a server. - <strong>type="reset"</strong>: it is used to reset all the values of an input or inputs to its initial value.
<button type=”button” onclick="openModal()">
Open Modal
</button>
It can only be activated by pressing the keys <u>Enter</u> or <u>Space</u>.
Screen Readers, generally, announce buttons in the following way: <strong>"Button, [Accessible Name of the button]"</strong>. It is extremely important to provide a descriptive and correct accessible name to the element.
It is completely unnaceptable, a bad practice and goes against the native behavior of the element, forcing it to behave as a link by doing the following:
<button onclick="window.location.href='/'">
Go to homepage
</button>
If you need to do this, it means that you need a link.
<button> with the state aria-expanded and the focus should stay put.<a href="#section">. There is no page load, updated the url, lands the user at a destination.<button> and when the items load, the focus should be placed in the first item of the new items.<a href="/destination">.<button> with the states aria-haspopup and aria-expanded.<button>.<a> with the attribute <u>download</u>.<a> stretched ::after.It is vital for keyboard and screen reader users to have a visual and logic focus on interactive elements. Never do outline: none without providing a focus style:
a:focus-visible,
button:focus-visible {
outline: 4px solid #0066ff;
outline-offset: 4px;
}
gemmaI ported the whole Gemma-4 family — E2B, E4B, 12B, 31B, and the 26B-A4B MoE — to run on...
communityHey DEV, I'm Tobore. Let's actually connect. I've been on here for a while now, mostly writing and...
ai(yep, kinda clickbait, just for the funsies 😊) At the beginning of the year, I relaunched my...
aiMy laptop was sitting idle with the fan at full tilt. Nothing was running that I knew of. The culprit...
githubactionsI Built a Thing! TL;DR — Google Gemini-based Pull Request reviews and Issue Triaging for...
aiI've been hearing the word "harness" thrown around a lot lately. I assumed it just meant "the IDE" or...
Workflows from the Neura Market marketplace related to this CoPilot resource