Correct way to use Aria-labelledby and Aria-describedby?

Asked

Viewed 31 times

2

Is there a problem in adding values from class instead of id in the attributes aria-labelledby and aria-describedby? This will affect something regarding accessibility?

For example:

<div class="dialog" role="dialog" aria-labelledby="title" aria-describedby="description">
  <h2 class="title">Título 1</h2>
  <p class="description">Informação 1</p>
  <button class="close" aria-label="close">x</button>
</div>

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.