I'm wondering how I can show multiple divs after a user clicks on an img link with div "importantImg" below using jquery (importantImg isn't below but is in my program). The problem is that this is just one snippet of the entire page that also has divs, so I don't want to make my select be "div," I just want to interact with these 4 specific divs and show them all, including their html content. Here's the html that contains the 5 divs:
If you want to access a specific element in jQuery, then use the #selector, as you've done, but if you want to access a group of elements, I would suggest assigning a class to them and then use the .selector to get to all the elements of that class.
So in the code below I have assigned a click function to the specific importantImg ID, but then iterate through each class member and change its display. I've used toggle but just change it to show if you only want one way display.
Bookmarks