I have 2 HTML documents
index.html
and services.html
In services.html, I have the following code:
<a class="nav-link" data-bs-toggle="tab" href="#ds-tab">Data Science</a>
<a class="nav-link" data-bs-toggle="tab" href="#ai-tab">AI</a>
<div class="tab" id="ds-tab">
<p>DS section </p>
</div>
<div class="tab" id="ai-tab">
<p>AI section </p>
</div>
The above code works correctly in services.html.
However, if I am on index.html
and include a link like this:
<a href="services.html#ai-tab">AI Section</a>
The link doesn't display the targeted div after navigating to the page.
I also tried using this approach but it didn't work either:
<a data-bs-toggle="tab" href="services.html#ai-tab">AI</a>