kot09
kot09

Reputation: 1037

Not able to collapse panel

I'm trying to use bootstrap to have a collapsible panel.

Here's my html:

<div class="col-xs-12 col-sm-6">
    <div class="panel panel-default">
    <div class="panel-heading">Amérique du nord/North America <span data-toggle="collapse" target-target="#panelBodyOne" class="collapsed">+</span></div>
            <div id="panelBodyOne" class="panel-body collapse"> Test</div>
      </div>
</div>

Can anyone tell me why this isn't working?

Upvotes: 1

Views: 53

Answers (2)

Bilal Maqsood
Bilal Maqsood

Reputation: 1246

Add data-target attribute on your span Tag

try this code

<div class="col-xs-12 col-sm-6">
    <div class="panel panel-default">
    <div class="panel-heading">Amérique du nord/North America 
     <span data-toggle="collapse" data-target="#panelBodyOne"    
       class="collapsed">+</span>
    </div>
            <div id="panelBodyOne" class="panel-body collapse">Test</div>
      </div>
</div>

Upvotes: 0

Will
Will

Reputation: 378

You have your target attribute named as target-target but it should be data-target.

<span data-toggle="collapse" data-target="#panelBodyOne" class="collapsed">+</span>

Upvotes: 2

Related Questions