Link or Button, that is the question. — DeepSeek Tips &…
    Neura MarketNeura Market/DeepSeek
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityDeepSeekDeepSeek
    CoPilotCoPilotStable DiffusionStable DiffusionMidjourneyMidjourney
    View All Directories
    OverviewRulesPromptsMCPsAgentsGamesBlogVideosGuidesCoursesCommunityTrending
    DeepSeekBlogLink 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
    Five Gemma-4 models, one accelerator: what porting E2B 31B to AWS Inferentia2 taught megemma

    Five Gemma-4 models, one accelerator: what porting E2B 31B to AWS Inferentia2 taught me

    I ported the whole Gemma-4 family — E2B, E4B, 12B, 31B, and the 26B-A4B MoE — to run on...

    X
    xbill
    Hey DEV, I'm Tobore. Let's actually connect.community

    Hey DEV, I'm Tobore. Let's actually connect.

    Hey DEV, I'm Tobore. Let's actually connect. I've been on here for a while now, mostly writing and...

    L
    Laurina Ayarah
    I burned through thousands of AI tokens. Then a friend did it for freeai

    I burned through thousands of AI tokens. Then a friend did it for free

    (yep, kinda clickbait, just for the funsies 😊) At the beginning of the year, I relaunched my...

    P
    Paulo Henrique
    Claude might be saturating your machineai

    Claude might be saturating your machine

    My laptop was sitting idle with the fan at full tilt. Nothing was running that I knew of. The culprit...

    S
    Sidhant Panda
    Automated GitHub Code Reviews Using Google Geminigithubactions

    Automated GitHub Code Reviews Using Google Gemini

    I Built a Thing! TL;DR — Google Gemini-based Pull Request reviews and Issue Triaging for...

    D
    Darren "Dazbo" Lester
    What is an "agentic harness," actually?ai

    What is an "agentic harness," actually?

    I've been hearing the word "harness" thrown around a lot lately. I assumed it just meant "the IDE" or...

    T
    Tilde A. Thurium

    Stay up to date

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

    Neura Market LogoNeura Market

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

    Neura Market

    Custom AI Systems & Services

    Our team of experienced AI builders will help build custom AI systems, workflows, and solutions for your business.

    Request custom work

    Ready-made automations for this

    Workflows from the Neura Market marketplace related to this DeepSeek resource

    • Learn n8n Keyboard Shortcuts with an Interactive Hands-On Tutorial Workflown8n · $24.99 · Related topic
    • Learn API Fundamentals with an Interactive Hands-On Tutorial Workflown8n · $24.99 · Related topic
    • Test Your JSON Skills with Interactive Challenges and Instant Feedbackn8n · $24.99 · Related topic
    • Create Evergreen Content with GitHub, Dynamic Images, & URL Redirectsn8n · $14.99 · Related topic
    Browse all workflows