Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8858799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:54:38+00:00 2026-06-14T14:54:38+00:00

I have two submenus which I hightlight them when they are active with this

  • 0

I have two submenus which I hightlight them when they are active with this jquery code:

<script type="text/javascript">
$(document).ready(function(){
    $('#links').click(function(){
        $(this).addClass('selected');
        $(this).siblings().removeClass('selected');
    });
})
 </script>

but now I have another submenu which I want to use the same code but it doesnt work because the siblings() function wont work in it because the links are under li tag! and here is the code I tried for it:

<script type="text/javascript">
$(document).ready(function(){
    $('.tabs_rubriken  a').click(function(){
        $(this).addClass('selected');
        $(this).siblings().removeClass('selected');
    });
})
 </script>

and when I click on them they get hightlighed but they wont remove the class ‘selected’ when other link is clicked in that menu. by the way this menu must be ordered with ul li.

THe markup:

<div id="tab2">
<ul class="tabs_rubriken">
    <li><a class="submenu_produkts_links2" href="#armreifen">Armreifen</a></li>
    <li><a class="submenu_produkts_links2" href="#colliers">Colliers Anhänger</a></li>
    <li><a class="submenu_produkts_links2" href="#ohrschmuck">Ohrschmuck</a></li>
    <li><a class="submenu_produkts_links2" href="#ringe">Ringe</a></li>
</ul>
<div id="armreifen">[tabs slidertype="images" auto="yes" autospeed="4000"]
[imagetab width="800" height="500"] image.png [/imagetab]
[imagetab width="800" height="500"] image.png [/imagetab]
[/tabs]</div>
<div id="colliers">Colliers Anhänger</div>
<div id="ohrschmuck">Ohrschmuck</div>
<div id="ringe">Ringe</div>
</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:54:39+00:00Added an answer on June 14, 2026 at 2:54 pm
    $(document).ready(function(){
        $('.tabs_rubriken a').click(function(){
            $('a.selected', this.parentElement.parentElement).removeClass('selected');
            $(this).addClass('selected');
        });
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have piled all of my JavaScript/jQuery code in one document, and I am
I have two classes which depend on each other. I've solved this problem before
Assume we have a Menu class that has SubMenus (which is the same type
Have two folders with approx. 150 java property files. In a shell script, how
I have two classes (MVC view model) which inherits from one abstract base class.
I have two columns say Main and Sub . (they can be of same
Have two tables say ABC and XYZ and contain one column which data will
I have this script: $(#menu ul li).mouseover( function () { $(this).find(.submenu).fadeIn(slow); } ); var
Taxonomy Menu created two menus, which have not gone even after I disabled it.
I have a C# form into which I've placed a left-docked MenuStrip . This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.