<a> and <button> look interchangeable: both are clickable, both can run JavaScript, both can be styled to look like whichever the designer prefers. The actual choice between them is a semantic and security decision, not a visual one. <a> means "go somewhere I can bookmark and share." <button> means "do something right now on this page." Get it wrong and you break the back button, break middle-click, break screen readers, or — in the worst case — open a hole that lets any page on the internet silently trigger destructive actions against your users.
The scenarios below are the ones that trip people up. A few have a clean right answer, a few have more than one right answer, and some come down to how the feature actually behaves at runtime rather than how it looks in a mockup. Pick what you'd reach for — the explanation reveals as soon as you click, and you can change your pick at any time. Most questions expect a single choice; one question (the shuffle toggle) accepts multiple answers and uses checkboxes instead.
A "Sign out" option in the top navigation bar.
A "Shuffle" toggle in a music player that turns random playback on and off.
A "Name" column header in a data table that sorts rows when clicked, with no URL change.
A "Learn more about our pricing" option next to a plan selector on a signup form.
A "Continue to payment" option at the bottom of the delivery address step in a multi-step checkout.
You want a whole product card to link to /product/42, with a "Save for later" button inside the card that saves to a wishlist without navigating away.
A "Back to top" control that scrolls the user to the top of a long page.
A "Clear form" option that resets all fields to empty.
A tab interface switching between "Overview", "Reviews", and "Specs" panels — with no URL changes.
A top-level nav item "Products" that both navigates to /products AND expands a dropdown submenu when clicked.
A video player's progress bar that lets the user click or drag to scrub to a specific timestamp.
A language selector in the footer showing EN, FR, and DE.
A "Delete account" option at the bottom of a settings page.
A filter chip "Shoes" that narrows search results and updates the URL to ?category=shoes.
A "Copy link" option that copies the current URL to the clipboard.
The last item in a breadcrumb trail (Home › Products › Laptops), representing the page the user is currently viewing.
A "Skip to main content" option at the very top of the page, visually hidden at rest but shown when it receives keyboard focus.
A notification bell icon in the top nav that, when clicked, opens a dropdown showing recent notifications.