From looking at your html structure it's really nice and clearly named classes, so we'll done there!
To make your html fully valid and accessible, you just need to change the questions into a button tag (an interactive element so you get keyboard and assistive tech functionality, focus state etc) and the answer into a paragraph tag (designed to hold text, unlike a div)
You could make your js a lot simpler by purely toggling one class like is-open
on the closest parent of the question, and handle the rest with css. No need to be changing multiple things on click, just the presence of that class is enough. So css might look like ".is-open .image-class { // rotate icon }
etc
I hope that makes sense and is helpful (if it is, remember to upvote comments 😉)
@DEmanderbag
Posted
@grace-snow thank you for this advice, I will try to change HTML structure to make more sense and be more accessible.
Thank you for the advice with JS and CSS as well, sounds like something I can do thanks.