Targeting Hidden DIv

Hi I have a dropdown nav that I want to target certain
divs as a link I have my content in tabs. Website
it does not go the respective div I need the JS script to
do this I found this one on a different post:

        (function activateTabFromHash() { if (location.hash) { var tabLink = document.querySelector('a[href="' + location.hash + '"]'); if (!tabLink) { return false; }; if (location.hash) {
      setTimeout(function() {
        window.scrollTo(0, 0);
      }, 1);
    } } })();

Do I need to place my fragment id in the ‘hash’?

These are the links in my header “products” dropdown:

<li><a href="">Sonic Toothbrush</a></li>
                    <li><a href="">Sonic Toothbrush Heads</a></li>
                    <li><a href="">Sonic Toothbrush Travel</a></li>
                    <li><a href="">Sonic Toothbrush Plus</a></li>

Targeting these: (example)

<div role="tabpanel" class="tab-pane prd-wrap" id="sonictravelplus">

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.