Here is the structure of my HTML code :
{# Navigation for xs screens #}
<div class="small-screen-nav hidden-lg hidden-md hidden-sm col-xs-12" style="padding: 0;">
<ol class="breadcrumb" style="padding: 0px 7.5px">
<li><a href="#" id="make" class="active">Make</a></li>
<li><a href="#" id="model">Model</a></li>
</ol>
</div>
{# Navigation for sm, md, lg screens #}
<div id="calculation-menu" class="col-lg-2 hidden-xs">
<div class="list-group">
<a href="#" id="make" class="list-group-item active">Make</a>
<a href="#" id="model" class="list-group-item">Model</a>
</div>
</div>
The jQuery code I am using is as follows :
<script>
$(document).ready(function () {
$('#make').removeClass('active').html("Some text");
$('#model').addClass('active');
})
</script>
However, there is an issue where the code is targeting the hidden navigation. On large screens, the first navigation is hidden, but the jQuery code continues to target it instead of the visible navigation (second one).
Does anyone have a solution to this problem?