Sorry to tell you this, but you mustn't ever add click listeners to non-interactive elements like divs! Always test with a keyboard at least.
You'll need to change the markup on this to use a button with the required state information via aria. And once that's done, you'll need to change the js and maybe css too.
I strongly recommend against messing with in-line styles in JavaScript. Keep the concerns separate. Let JavaScript handle only the interactivity such as toggling aria values and optionally toggling a class. Let CSS handle all styling (including showing the correct icon).
Here is a post about how to build a disclosure (accordion) pattern like this.
Marked as helpful
@PetyaBiszeps
Posted
@grace-snow thank you for this valuable feedback! No need to apologize for saying that I did something wrong since I'm completely okay with critique, I would say even more, I'm really thankful for having this kind of review, with explanation and source to learn more! Gonna look at this deeper now and fix this solution now. Again, thank you for review and feedback <3