Some HTML elements, like some places, songs, and smells, have a disproportionate significance for some people. For example, among web accessibility pr

The button element: HeydonWorks

submited by
Style Pass
2024-11-15 19:30:14

Some HTML elements, like some places, songs, and smells, have a disproportionate significance for some people. For example, among web accessibility practitioners, any mention of the <button> element will recall a multitude of painful failures and cherished triumphs. Such is the element’s power to make or break the fundamental accessibility of a web interface.

The button element is undoubtedly the most misunderstood and least utilized of all HTML. As a sometime accessibility consultant myself, it’s no exaggeration that I’ve encountered fewer buttons that are <button>s than are other, incorrect elements. That is, ones not helpfully called “button”.

In the early 2000s, JavaScript accounted for relatively little functionality in web pages. For the most part, interactivity was shared between hyperlinks and forms. Hyperlinks transported you between pages and forms enabled you to submit data to servers.

To change the state of a web page, you might submit a form telling the server to re-render that page according to new data. And that’s the only time anyone ever saw a <button> element: as a submit button.

Leave a Comment