I am currently working on a project with 2 divs, where I want to display only one div at a time and hide the other. For example, if div 1 is visible, then div 2 should be hidden. You can check out what I have done so far in this demo.
Everything is working as expected except that both divs are visible when the page loads. My goal is to hide div 1 initially and have div 2 visible first. Can anyone suggest how I can achieve this?
<div class="container">
<div class="row">
<div class="col-6 card-body targetDiv" id="div1">
<div class="form-group pt-4">
<input type="text" class="form-control" id="inputAddress" placeholder="1234 Main St">
</div>
<div class="form-group">
<input type="text" class="form-control" id="inputAddress2" placeholder="Apartment, studio, or floor">
</div>
<a class="btn btn-secondary showSingle" target="2" title="Add Reference"><i class="fas fa-ellipsis-v"></i></a>
</div>
<div class="col-6 card-body targetDiv" id="div2">
<div class="form-group pt-4">
<input type="text" class="form-control" id="inputAddress2" placeholder="Apartment, studio, or floor">
</div>
<a class="btn btn-secondary showSingle" target="1" title="Add Reference"><i class="fas fa-file"></i></a>
</div>
</div>