Link or Button, that is the question. — Stable Diffusion…
    Neura MarketNeura Market/Stable Diffusion
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityStable DiffusionStable Diffusion
    DeepSeekDeepSeekCoPilotCoPilotMidjourneyMidjourney
    View All Directories
    OverviewPromptsBlogVideosGuidesCoursesCommunityModelsLoRAsComfyUI WorkflowsTrending
    Stable DiffusionBlogLink 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.

    <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:

    <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.

    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.

    <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:

    <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:

    a:focus-visible,
    button:focus-visible {
      outline: 4px solid #0066ff;
      outline-offset: 4px;
    }
    

    Tags

    a11ywebdevfrontendhtml

    Comments

    More Blog

    View all
    Context bankruptcy: The case for strategic forgetting for AI Agentsai

    Context bankruptcy: The case for strategic forgetting for AI Agents

    Most of us have seen a coding agent fail to complete a task we know it can do. We just don't...

    J
    James O'Reilly
    Parallel Compliance Engine: Drive-to-Sheets Multi-Agent Orchestrationgooglecloud

    Parallel Compliance Engine: Drive-to-Sheets Multi-Agent Orchestration

    When building Generative AI applications, developers often encounter a massive bottleneck: sequential...

    A
    Aryan Irani
    Is It Ethical to Post and Ask About Circuits on Dev.to?discuss

    Is It Ethical to Post and Ask About Circuits on Dev.to?

    I’ve been thinking about sharing some electronic circuit posts on Dev.to — small circuits, DIY...

    C
    codebunny20
    The One-Click Exporter: AI Studio Antigravity, Probed to Its Limitsagents

    The One-Click Exporter: AI Studio Antigravity, Probed to Its Limits

    What nobody tells you about exporting your multi-agent prototype to a local workspace. Every...

    L
    leslysandra
    Guarding the till while autonomous data agents do the diggingagenticarchitect

    Guarding the till while autonomous data agents do the digging

    Autonomous agents are genuinely good at answering messy business questions. Give one an LLM and a set...

    S
    Sireesha Pulipati
    Return on Attention: Why AI Code Reviews Are Wearing Us Outai

    Return on Attention: Why AI Code Reviews Are Wearing Us Out

    PR 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.

    C
    christine

    Stay up to date

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

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for Stable Diffusion 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.

    Ready-made automations for this

    Workflows from the Neura Market marketplace related to this Stable Diffusion resource

    • Interactive Slack Approval & Data Submission Systemn8n · $19.99 · Related topic
    • Transform Your Images: Interactive Editor with FLUX Fill Tooln8n · $12.94 · Related topic
    • Interactive GitHub API Chatbot with RAG and OpenAI Integrationn8n · $4.97 · Related topic
    • Interactive Image Editor with FLUX.1 Inpainting Tooln8n · $24.99 · Related topic
    Browse all workflows