Is it possible using VueJS and vanilla JS to collapse one of many divs?
I have data within separate cards featuring a title and a body - I am wanting the body of the card to collapse/expand when the title is clicked.
VueJS is being used, and I would like to keep JQuery out of it for the time being, focusing on vanilla JS.
See this fiddle for an example of what it looks like. Please bare in mind that I am FULLY AWARE of not using the same ID for multiple elements - this was a quick demo for illustration purposes.
<div class=section>
<div class=title @click=toggle><span class=toggleIcon id=toggleIcon>{{toggleIcon}}</span>Toggle This Section</div>
<hr/>
<div class=body id=toggle>
<img style=height:100px src=https://cdn.vox-cdn.com/thumbor/Pkmq1nm3skO0-j693JTMd7RL0Zk=/0x0:2012x1341/1200x800/filters:focal(0x0:2012x1341)/cdn.vox-cdn.com/uploads/chorus_image/image/47070706/google2.0.0.jpg>
</div>
</div>
The problem I have at the moment is that I can collapse a div, but not individual divs.