Link or Button, that is the question. — CoPilot Blog
    Neura MarketNeura Market/CoPilot
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityCoPilotCoPilot
    DeepSeekDeepSeekStable DiffusionStable DiffusionMidjourneyMidjourney
    View All Directories
    OverviewRulesPromptsMCPsAgentsBlogVideosGuidesCoursesCommunityPluginsTrendingGenerate
    CoPilotBlogLink or Button, that is the question.
    Back to Blog
    Link or Button, that is the question.
    a11y

    Link or Button, that is the question.

    Mica June 22, 2026
    0 views

    What is a Link? Definition A link is an interactive element that redirects the...

    ## What is a Link? ### Definition 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. ### Semantic 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`. ```html <a href="/URL"> Go to main page </a> ``` ### Keyboard Interaction 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 Reader Interaction 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. ### Bad Practice 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: ```html <a href="javascript:void(0)" onclick="openModal()"> Open Menu </a> ``` ```html <a href="#" role="button" onclick="button()"> Link with role button </a> ``` If you need to do this, it means that you need a link. ## What is a button? ### Definition 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. ### Semantic 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. ```html <button type=”button” onclick="openModal()"> Open Modal </button> ``` ### Keyboard Interaction It can only be activated by pressing the keys <u>Enter</u> or <u>Space</u>. ### Screen Readers Interaction 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. ### Bad Practice 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: ```html <button onclick="window.location.href='/'"> Go to homepage </button> ``` If you need to do this, it means that you need a link. ## Which one should I use: link or button? - Do you need an expandable section? use a `<button>` with the state `aria-expanded` and the focus should stay put. - Do you need to jump to a section on the same page? use an `<a href="#section">`. There is no page load, updated the url, lands the user at a destination. - Do you need to load more items into the current list? use a `<button>` and when the items load, the focus should be placed in the first item of the new items. - Do you need to redirect the user to a new location to read more about something? use an `<a href="/destination">`. - Do you need to open a menu? use a `<button>` with the states `aria-haspopup` and `aria-expanded`. - Do you need to play or pause a video? use a `<button>`. - Do you need to dowload a file? use a `<a>` with the attribute <u>download</u>. - Do you need a card that leads to a detail page? use a `<a>` stretched `::after`. ## Focus Style for Interactive Elements 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: ```css a:focus-visible, button:focus-visible { outline: 4px solid #0066ff; outline-offset: 4px; } ```

    Tags

    a11ywebdevfrontendhtml

    Comments

    More Blog

    View all
    Minimalist EKS: The Easy Waykubernetes

    Minimalist EKS: The Easy Way

    Amazon EKS manages the Kubernetes control plane, but you remain responsible for provisioning the...

    J
    Joaquin Menchaca
    Never forget to enter the Stern Grove lottery again!ai

    Never forget to enter the Stern Grove lottery again!

    Browser automation with Playwright, Python, GitHub Actions, and Entire to auto-enter San Francisco Stern Grove concert lotteries each week!

    L
    Lizzie Siegle
    A Free Screenshot Editor That Never Uploads Your Imagetypescript

    A Free Screenshot Editor That Never Uploads Your Image

    A free screenshot and image editor that runs entirely in your browser. Keeping every edit reversible and handling big phone photos, in plain TypeScript and Canvas2D.

    M
    Martin Stark
    I built a CLI to break my highlights out of Apple Booksshowdev

    I built a CLI to break my highlights out of Apple Books

    A macOS CLI + MCP server that exports Apple Books highlights to Markdown and gives AI assistants direct access to your reading notes.

    A
    Andrey Korchak
    A Developer's Guide to Agent Hooks in Antigravity CLIai

    A Developer's Guide to Agent Hooks in Antigravity CLI

    Motivation To be quite honest, "Hooks"—the shell commands we trigger at specific points...

    T
    Tanaike
    Tactical vs. Strategic Agentic AI Development — A Playbook for Developersagents

    Tactical vs. Strategic Agentic AI Development — A Playbook for Developers

    The Strategic Engineer: Why Writing Code Is No Longer Your Most Valuable Skill ...

    A
    Adewumi Saheed Adewale

    Stay up to date

    Get the latest CoPilot prompts, rules, and resources delivered to your inbox weekly.

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for CoPilot and more.

    Content Types

    • Rules
    • Prompts
    • MCPs
    • Agents
    • Guides

    Platforms

    • ChatGPT Directory
    • Claude Directory
    • Gemini Directory
    • Cursor Directory
    • Grok Directory
    • Perplexity Directory
    • DeepSeek Directory
    • CoPilot Directory
    • Stable Diffusion Directory
    • Midjourney Directory
    • All Directories

    Resources

    • Blog
    • Documentation
    • Help Center
    • Marketplace

    Legal

    • Privacy Policy
    • Terms of Service

    © 2026 Neura Market. All rights reserved.

    |

    Not affiliated with any AI platform vendors.