Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As someone whose been learning the last few years, a lot of learning materials suggest you don’t make a proper form element and just make your own button instead of using using a form element and all the built in benefits it brings for reasons I don’t really know. I’ve probably wondered about this sort of thing for few good hours total, but I guess this comment steers me in the right direction.


Yeah, don't do that unless you have good reason to do so.

Browsers have a standard, default, expected behavior. Sometimes, in rare cases, it makes sense to break that in order to do something else instead. But you shouldn't just silently break it for no reason other than to confuse the user.


In addition to what others have mentioned, using elements for their stated/official purpose helps with accessibility. Yes, you can use the role attribute, but some accessibility technology works more completely if you use proper elements. (And just can be easier to use; I guess the best way to compare it is using VO on a site where everything is just divs is like the blind version of this[0] Or Comic Sans. Just visceral 'ugh'.).

[0] https://www.theworldsworstwebsiteever.com/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: