first I would put your JS in a separate file and link it in the HTML also this might help https://daily-dev-tips.com/posts/vanilla-javascript-event-listener-on-multiple-elements/
Marked as helpful
0
I'll appreciate every advice, especially concern JS(how can i shorten code ) Thanks
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord