Hi, I have a problem and I don’t really know how to solve it. In the code, I attached , I created a card for each image but when I click on view info they all open and only the first card has the information … I know I should do something like “querySelectorAll to get the buttons” but I don’t know how to do…Someone can help me solve this code…Thanks
Hey Florinda,
nice to meet you!
Actually every card has its data, but it’s hidden.
Currently, you are using querySelector
. The MDN docs say:
querySelector()
returns the first Element within the document that matches the specified selector.
So this is always your first box.
Now let’s think about this:
If you would have to instruct a kid to do this by hand, how would you do this?
- Click on the 2nd card’s
View Info
- …
- …