
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;
}
aiMost of us have seen a coding agent fail to complete a task we know it can do. We just don't...
googlecloudWhen building Generative AI applications, developers often encounter a massive bottleneck: sequential...
discussI’ve been thinking about sharing some electronic circuit posts on Dev.to — small circuits, DIY...
agentsWhat nobody tells you about exporting your multi-agent prototype to a local workspace. Every...
agenticarchitectAutonomous agents are genuinely good at answering messy business questions. Give one an LLM and a set...
aiPR volume went up, ticket quality didn't, and the gap got filled with LLMs on both sides of the review: bots reviewing, bots replying, bots occasionally arguing with bots about priorities that only existed in a teammate's head. Our CEO named the actual problem, and it's bigger than code review.
Workflows from the Neura Market marketplace related to this Stable Diffusion resource