Based off an answer I recently read, it seems a button
has categories including “interactive content”, but a div
does not fall into the “interactive content” category. If a div
element has role="button"
attached to it would a modern browser then interpret that element as having a category of “interactive content”?
<div role="button" ...
The MDN agrees that buttons are “interactive” and further states… (emphasis mine)
Adding role=”button” tells the screen reader the element is a button, but provides no button functionality
…so if the element “is a button, but provides no button functionality”, I would assume that means the role
makes it interactive content. The ARIA specification says the following about a “Role”: (emphasis mine)
Main indicator of type. This semantic association allows tools to present and support interaction with the object in a manner that is consistent with user expectations about other objects of that type.
Maybe I’m getting too hung up on the terminology and there’s not a functional difference here. Logically, I think that <div role="button"
means an element is “interactive content”, but it would be satisfying to see where in the specification it’s called out that a div
element becomes “interactive content” through the role="button"
attribute.
Is there a section in the HTML Standard that calls that out?