Menu

Showing posts with label Best Practice. Show all posts
Showing posts with label Best Practice. Show all posts

What is the best accessible element for open/close a modal?

Putting empty href attribute in anchor element is not good practice of accessibility friendly. Hence, button is the right element to handle the open and close a modal or dialog. 

e.g. <a href="#">X</a> // not good

<button id="modal-toggle">X</button> // right way to create

Now, create a handler function to handle the open and close with button id.