Re:Just Use a Button
by xnx on Friday October 31, 2025 @02:56PM
(#45775418)
Page makes no mention of <input type="button">. Are there any situations where that should be used?
[ Parent
| on HN ]
From MDN:
> Note: While <input> elements of type button are still perfectly valid HTML, the newer <button> element is now the favored way to create buttons. Given that a <button>'s label text is inserted between the opening and closing tags, you can include HTML in the label, even images.
It's a thing from the times when <button> did not exist. Other use cases were for supporting IE.
Today just use button.
Re:Just Use a Button
by cferdinandi on Friday October 31, 2025 @03:47PM
(#45775960)
I would literally never use <input type="submit|button"> for anything when the <button> element is an option, personally.