I'm currently developing a React App that functions as a calendar, allowing users to click on specific days displayed as large squares to view information for that day. For accessibility purposes, I initially considered using <button>
elements but after some research (Why can't a <button> element contain a <div>?) + (https://www.w3.org/TR/2012/WD-html5-20120329/the-button-element.html#the-button-element), it appears that nesting divs inside buttons is not the correct approach. Another option could be making each day a clickable <div>
, and manually adding appropriate attributes like tabIndex
and role
for better accessibility compliance.
What would be the best html tag or method to create a clickable area with the ability to house multiple <div>
elements within it?