Regarding Bootstrap 4:
I have a btn-group with three radio buttons and one of them is pre-selected on page load. I want to do some action depending on the selected button - but I cannot get it going.
Here is my code so far:
<div class="btn-group btn-group-sm mb-2" id="container__Direction" role="group" data-toggle="buttons">
<label class="btn btn-group-btn active">
<input type="radio" data-toggle="button" id="input__Direction_Return" checked /> <--> Return
</label>
<label class="btn btn-group-btn">
<input type="radio" data-toggle="button" id="input__Direction_OneWay" /> --> One way
</label>
<label class="btn btn-group-btn">
<input type="radio" data-toggle="button" id="input__Direction_MultiStop" /> ->-> Multi Stop
</label>
</div>
<!-- Hide this Div if "OneWay" is selected -->
<div id="container__Inbound_Date">
<label for="input__Date">Date:</label><br/>
<input type="date" id="input__Date" />
</div>
$('#input__Direction_OneWay').on('click', function () {
if ($(this).is(':checked')) {
$("#container__Inbound_Date").hide();
}
});
Fiddle: https://jsfiddle.net/SchweizerSchoggi/ax85208e/2/
The Div below the btn-group should be hidden when btn "OneWay" is selected.