Reputation: 3358
I am trying to get the active element's role attribute. I can get all the other attributes like id
, class
, title
and so on, as below
document.activeElement.title
document.activeElement.class
document.activeElement.tabindex
...but I can't get the role attribute using document.activeElement.role. It throws undefined
.
How do I get the role
attribute?
Upvotes: 1
Views: 2362