I'm trying to show the value in an input field when the radio-button is checked/clicked. But it does not work when I include bootstrap.min.js
JSFiddle
$('input:radio').click(function() {
document.getElementById("whatever").innerHTML = $(this).val();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="container">
<div class="btn-group btn-group-toggle d-flex" data-toggle="buttons">
<label class="btn btn-primary w-100 active">
<input type="radio" name="options" value="5" id="option1" autocomplete="off"> 5
</label>
<label class="btn btn-primary w-100">
<input type="radio" name="options" value="10" id="option2" autocomplete="off"> 10
</label>
<label class="btn btn-primary w-100">
<input type="radio" name="options" value="15" id="option3" autocomplete="off"> 15
</label>
<label class="btn btn-primary w-100">
<input type="radio" name="options" value="20"id="option4" autocomplete="off"> 20
</label>
</div>
</div>
<div class="container">
<div class="form-group">
<input id="whatever" class="form-control">
</div>
</div>
If the user clicks on say "15", then the value shows 15 in the input field.
PS: The code works when I disable the bootstrap.min.js
and add <div id="whatever"></div>
.