@md5dalton
Posted
Hi Oviedev. Good work on your solution.
Here are a few of my suggestions:
- Remember to add
alt
attribute to yourimg
tags for accessibility purposes. - In your Javascript code I've noticed that
document.getElementById
has been repeated quite a couple of times, so to keep your code DRY (Do not Repeat Yourself), why not write a helper function to handle that, so your code becomes a little bit leaner and easy to maintain:
const getElement = selector => document.querySelector(selector)
You can even go further by replacing showItems()
and hideItems()
with toggleItems()
.
Please feel free to ask if you need further explanation.
Marked as helpful
@ovie-best
Posted
@md5dalton Thanks a lot. I will try it out.