@elaineleung
Posted
Hi Noah, first off, I think you did a good job putting this together. I just got a couple of quick comments after checking out the site:
-
I see that you're using
:focus
for the button that got selected. The problem with this is, if I accidentally click on something else that is not a button (such as background text), the style of the selected button is no longer there, and it looks like no button is selected. I don't suggest using the focus style because of the problem I mentioned and also because the focus style is not meant to be used this way. What I would do instead is to use JS to add or remove a "selected" style class. -
For the star icon, you can try using
aria-hidden
to hide it from screen readers since it's just an icon and really doesn't have much meaning to convey. -
I see that you've used the
onclick
attribute in the HTML for the buttons. While there's nothing really wrong with this, I do suggest keeping all the JS in the script, and also, it's more common now to use event listeners instead of onclick handlers when writing in plain (vanilla) JS.
That's all the thoughts I have, great work over all!
Marked as helpful