Button element: Has the option to switch to <button>

Currently, the button element outputs a link HTML tag (<a href="/">Button Name</a>).

To make a button using the <button> HTML tag, I think I can use a container > set custom HTML tag to button(I have yet to try it for the button). But, I think this is not the right way to go as it’s related to the button element.

Therefore, I think we should have the option to switch the button to a button HTML tag when using a button element. The HTML button tag is needed for some situations sometimes.

Thank you!

7 Likes

Why the button is not a button I will never understand. When is it ever useful to have a button as a span?

Guys, please make a button element a button by default. I mean of course it’s not hard to type it manually but what if we forget? That’s a major a11y screw up.

Thanks.

It should not be a button element unless it’s on a form (or other special use cases)

Links that look like buttons should be links.



When To Use The Button Element | CSS-Tricks
You use it when, uhm, you want a button on your page that users can click, right? Well, unfortunately it’s a bit more complicated than that. It’s not too bad
https://css-tricks.com/use-button-element/

The button HTML element is an interactive element activated by a user with a mouse, keyboard, finger, voice command, or other assistive technology. Once activated, it then performs an action, such as submitting a form or opening a dialog.

if it’s not doing that it’s a link that looks like a button and so it should be a link <a>

2 Likes

Okay, You are right Tony. I just think it’s confusing is all.