user2744722 user2744722 - 7 months ago 25
Javascript Question

reset bootstrap radio button

this has got to be a duplicate question but I can't find the answer. how do you reset the bootstrap radio buttons?

according to the documentation it is reset but it doesn't see to do anything I also tried using jquery to change it but nothing.

$('#Reset').click(function(){
$('#option1').button('reset');
$("#option1").prop('checked', true);
});


here is the fiddle. https://jsfiddle.net/m1jryanh/ I am clicking on a different button then hit the reset button hoping it will reset but it does not.

Answer

You can just perform a click on #option1.

$('#Reset').click(function(){
  $("#option1").click();
});

Here's the updated fiddle.