I am making a website, and want the "Meet the animals" button to scroll to the referenced section, then close the popup. Right now, it is scrolling down to the section I want but is not closing after it scrolls.
function hide() {
document.getElementById('question').style.display = 'none';
}
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css" rel="stylesheet">
<div class="modal fade" id="question" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<h4>What do you truly need in a furry companion?</h4>
<br>
<div class="card">
<div class="card-body">
<div class="row">
<div class="form-group col-sm-4">
<label for="typeOfAnimal">Type of Animal</label>
<select class="form_select" id="typeOfAnimal" onchange="showDiv(this)">
<option value="0" data-target="myCarousel">Any</option>
<option value="1" data-target="dogCarousel">Dog</option>
<option value="2" data-target="catCarousel">Cat</option>
</select>
</div>
<div class="form-group col-sm-3">
<label for="size">Size</label>
<select class="form_select" id="size">
<option>Any</option>
<option>Small</option>
<option>Medium</option>
<option>Large</option>
</select>
</div>
<div class="form-group col-sm-3">
<label for="other">Other</label>
<select class="form-select" id="other">
<option>N/A</option>
<option>Hypoallergenic</option>
</select>
</div>
</div>
</div>
</div>
<div class="card-footer">
<a href="indexQUESTION.html#testimonials" class="main-button" data-toggle="modal" data-target="" data-dismiss="modal" onclick="hide()">Meet the animals</a>
<button type="button" class="main-button" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js"></script>