I'm currently working on creating a dynamic navbar that updates the content based on which navigation pill is selected. For some reason, the content in my div.tab-content isn't changing as expected...
Here is an example of the code I am using:
<head>
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9efcf1f1eaedeaecffeedeabb0acb0ad">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
</head>
<body>
<div class="container" id="navigation" role="navigation">
<!-- pills content -->
<ul class="nav nav-pills mb-3" id="detail_tab" role="tablist">
<li class="nav-item" role="presentation">
<a
class="nav-link active"
id="pill1"
data-mdb-toggle="pill"
href="#content1"
role="tab"
aria-controls="content1"
aria-selected="true"
>pill1</a>
</li>
<li class="nav-item" role="presentation">
<a
class="nav-link"
id="pill2"
data-mdb-toggle="pill"
href="#content2"
role="tab"
aria-controls="content2"
aria-selected="false"
>pill2</a>
</li>
</ul>
<!-- pills nav -->
<!-- pills content -->
<div class="tab-content clearfix" id="tablist-content">
<div
class="tab-pane fade show active"
id="content1"
role="tabpanel"
aria-labelledby="pill1"
>
content1
</div>
<div class="tab-pane fade" id="content2" role="tabpanel" aria-labelledby="pill2">
content2
</div>
</div>
<!-- pills content -->
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="03606c716643312d32322d35">[email protected]</a>/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="284a47475c5b5c5a4958681d061a061b">[email protected]</a>/dist/js/bootstrap.min.js" integrity="sha384-cuYeSxntonz0PPNlHhBs68uyIAVpIIOZZ5JqeqvYYIcEL727kskC66kF92t6Xl2V" crossorigin="anonymous"></script>
</body>
Any idea why it's not functioning correctly? Am I missing something?