Closed meowwwls closed 5 years ago
This pull request is automatically deployed with Now. To access deployments, click Details below or on the icon next to each push.
Latest deployment for this branch: https://teacherfund-git-fork-meowwwls-fix-donate-form-a11y-donatebtn.teacherfund1.now.sh
Currently, the donation form was using
div
elements for the form itself as well as the "donate" button. This is not semantic HTML, and it also removes a lot of built in accessibility and functionality the browser takes care of for us.I've changed it to use a
form
element and theonSubmit
event (vs theclick
event it was using which not only gives us semantic markup, but by using a form, anyone navigating with their keyboard can use theenter
key to submit it, which is expected behavior (and will trigger thedonate
function just as clicking the button does).I have also used a
button
element for the "donate" button, making things semantic as well as fully keyboard accessible.