Reputation: 16793
Click the Default button to add active class but why is the reset button not resetting the button state?
$('#reset').click(function(){
$('#test').button('reset');
})
HTML
<p>
<button id="test" type="button" class="btn btn-primary" data-toggle="button" aria-pressed="false" autocomplete="off">Default</button>
</p>
<p>
<button id="reset">
Reset
</button>
</p>
Example: http://jsfiddle.net/rdh579hc/1/
Upvotes: 1
Views: 6188
Reputation: 6538
You can do that to reset your button :
$('#reset').click(function() {
var button = $('#test');
button.attr('aria-pressed', "false");
button.removeClass('active');
})
Upvotes: 1