Lewis Day Lewis Day - 4 months ago 14
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

#virtual-gifts
div and
#external
div.

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>

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

Answer

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

Comments