Lewis Day Lewis Day - 1 year ago 73
HTML Question

target to divs with data-toggle collapse

What I'm trying to achieve is toggle two divs with one link; so at the same time when this link is clicked toggle the

div and

The link I'm trying to use;

<a href="#" data-toggle="collapse" data-target="#virtual-gifts #external">test</a>

The divs;

<div id="external" class="collapse">
This is the external div

<div id="virtual-gifts" class="collapse">
This is the virtual-gifts div

Answer Source

use comma , to separate the id #like this:

<a href="#" data-toggle="collapse" data-target="#virtual-gifts,#external">test</a>

See more info about Bootstrap data-attributes