Exercise Table:
<table class="table table-image" id="exercise_table">
<thead>
<tr class="bg-hercules-font">
<th scope="col">Exercise Name</th>
<th scope="col">Body Part</th>
<th scope="col">Select</th>
</tr>
</thead>
<tbody class="checkBox">
<tr>
<td>Bench Press</td>
<td>Chest</td>
<td>
<div class="form-check form-check-inline" id="checkkk">
<input class="form-check-input" type="checkbox" id="checktest" value="option1">
<label class="form-check-label" for="checktest"></label>
</div>
</td>
</tr>
<tr>
<td>Incline Bench Press</td>
<td>Chest</td>
<td>
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" id="checktest" value="option1">
<label class="form-check-label" for="checktest"></label>
</div>
</td>
</tr>
<tr>
<td>Ab Roll Outs</td>
<td>Abs</td>
<td>
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" id="checktest" value="option1">
<label class="form-check-label" for="checktest"></label>
</div>
</td>
</tr>
<tr>
<td>Cable Crunches</td>
<td>Abs</td>
<td>
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" id="checktest" value="option1">
<label class="form-check-label" for="checktest"></label>
</div>
</td>
</tr>
</tbody>
</table>
Script to Display Arrow Icon:
$('.checkBox :checkbox').change(function() {
var $this = $(this);
if ($this.is(':checked')) {
var newInput = $('<a href="#" id="next_page"><span style="color:#43425D;"><i class="fas fa-arrow-right fa-lg"></i></span></a>');
$('#here').empty().append(newInput);
} else {
$('#here').empty();
}
});
Div Where Arrow Appears:
<div class="d-sm-flex align-items-center justify-content-between mb-4" id="here">
</div>
The issue is that multiple arrow icons appear when clicking multiple checkboxes. Need a solution to display only one icon at a time and hide it when no checkbox is checked.