HeadlinesBriefing favicon HeadlinesBriefing.com

Button vs Link: Understanding HTML Action

Hacker News •
×

The Triptych Project proposesiconic changes to HTML, adding action and method attributes to the <button> tag. The core idea behind Button Actions is to clarify the difference between a button and a link. Links represent a destination; they can be re pensamentos, opened in new tabs, bookmarked, or copied. Buttons, on the other hand, trigger an action within the current context and do not provide those re‑contextualization affordances.

Misconceptions abound: many believe links are for navigation and buttons for everything else. In reality, buttons often perform navigation—such as a logout or search result redirect—while links can perform non‑navigation actions like mailto or file downloads. When navigation should be a button, it is one that occurs in a fixed context that cannot be re‑contextualized.

Without Button Actions, developers resort to anti‑patterns like styling a link as a button, which breaks semantics and accessibility. The new attributes allow a clean, script‑free implementation of actions such as Save, Save Draft, Cancel, and Delete directly in HTML.

This enhancement simplifies the web, making buttons truly capable of initiating network requests while preserving the distinct roles of links and buttons.