How to use the Button Element to improve Accessibility

https://www.flickr.com/photos/76283671@N00/184615745/in/photolist-hjcQ6-CT5pgQ-CumdwX-C5sAhC-28Zs7-4mU9Lt-6k7SvT-7cn5Yc-CtPwUF-p3X3-8UrcuU-C4NGDa-D3DzE-CAcJt3-oHuf4E-6pvEaD-5YKd7r-6qKhSD-7RpaW4-iKvMQ-4nbvGA-CcLRR-jhS3Ep-egcA6-8wJLSe-8Dey8L-3Z77Ko-29MJtF-xj9c79-6V5kt-5cP2kU-2ZeTTp-46bus-otp6bE-9M2nbC-ksbHbc-6Dy3TG-a7VyM4-7y7VvK-CZY8Eo-5dYszS-5MfNLD-C4Ftbo-51JLPP-3JDXL-7NKGVh-9EhzwC-9tYUfr-5t6hX2-3FZXdf
Reading Time: 8 mins

I’m still here on my ongoing mission of coding accessibly. There is one HTML element that has become a huge stepping stone for me once I learned how to properly use it. That stepping stone was the button element. What? The button element? Why the heck do we need that? Well, if you’ve ever seen code like below, or have written code like this ( points to herself ), then this post is for you:

 

To be honest, I’d been writing code like the above for years until I realized I was missing opportunities. I know other developers that also write code like the above. Why is this the case? Well, there have been some theories of ignorance and fear being the source. In my case, “semantics” was just one of those words that I didn’t come across in the beginning. I just wanted to build things that I could see. It was like trying to build a cabinet with a box full of tools without truly understanding the tools. Sure I can hammer in all the nails and call it a day. Or I can take the time to see what’s in the toolbox. Maybe I’ll find that a screwdriver might be a better tool for some areas of the end product then a hammer. In the end, using the right tools for the job will result in a higher quality product… or cabinet?

PS: Rachel is no good with analogies…

 

And semantics – what does that even mean? Take it from a gal who was thrown head first into web development from a fine arts degree and had to google words like “repository” during her first week. There’s so much lingo out there! Even now, as a more experienced dev, it makes my head spin. So let’s go over it all, shall we? How to use the button element and when it’s the right tool for the job.

Continue reading How to use the Button Element to improve Accessibility