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.
No comments:
Post a Comment