Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

202
Views
Add class if (hidden) anchor is

I'm writing a function to add a class to different menu items on several conditions. The first condition is already working great but now I have something different.

I have a page with some tabs #tab1,#tab2 and #tab3. However the anchor is invisible in the URL even if I switch between the tabs.

My current function:

jQuery(document).ready(function($) {
    if(window.location.pathname.indexOf("/konto/adressen/") !==-1) {
        $(".jet-custom-nav__item-6068").addClass("current-menu-item");
    }
    else if(window.location.hash == "tab1") {
        $(".jet-custom-nav__item-9886").addClass("current-menu-item");
    }
});

The default tab page refresh is #tab1. After refresh the class is added to the right menu item but somehow my code makes the URL anchor visible and if I switch to another tab it stays still active. I would appreciate any help with this not too many experience by now!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!