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 7843529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:34:15+00:00 2026-06-02T16:34:15+00:00

<ul class=current> <li> <a href=#nogo><b>Products</b> <div class=select_sub show> <ul class=sub> <li class=sub_show><a href=#nogo>Add product</a></li>

  • 0
 <ul class="current">
   <li>
       <a href="#nogo"><b>Products</b>
         <div class="select_sub show">
             <ul class="sub">
              <li class="sub_show"><a href="#nogo">Add product</a></li>
             </ul>
         </div>
       </a>
  </li>
</ul>


<ul class="select">
   <li>
       <a href="#nogo"><b>Item</b>
         <div class="select_sub">
             <ul class="sub">
              <li><a href="#nogo">Add Item</a></li>
             </ul>
         </div>
       </a>
  </li>
</ul>

1.after click Item link i want to add class in current ul current class and remove form other
it’s working by this code

$("ul").click(function(e){

  e.preventDefault();

 $(this).addClass("current").siblings().removeClass("current").addClass("select");

});

I have problem with second point

  1. When I click item link, I want add class select_sub show which div have class select_sub

I mean to say (if i click item link)

<ul class="select">
 <li>
   <a href="#nogo"><b>Products</b>
     <div class="select_sub">
         <ul class="sub">
          <li><a href="#nogo">Add product</a></li>
         </ul>
     </div>
   </a>
</li>
</ul>


<ul class="current">
 <li>
    <a href="#nogo"><b>Item</b>
      <div class="select_sub show">
         <ul class="sub">
          <li class="sub_show"><a href="#nogo">Add Item</a></li>
         </ul>
      </div>
   </a>
</li>
</ul>

Thanks in advance

  • 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-02T16:34:16+00:00Added an answer on June 2, 2026 at 4:34 pm

    If I understood your question correctly, then below should do the trick.

    $("ul").click(function(e){    
        e.preventDefault();
        var $this = $(this);
        var $siblings = $(this).siblings();
    
        $this.addClass("current"); //probably need to add .removeClass('select')
        $this.find('.select_sub').addClass('show');
    
        $siblings.removeClass("current").addClass('select');
        $siblings.find('.select_sub').removeClass('show');
    
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code which gives the menu item a class of 'current'.
I have the following JQuery statement and it is adding the class 'current' but
My current class is planning on creating a basic networked game, but we have
Is there a statement in AS3 that will return current class and/or scope? I'd
I know you can do this.GetType().FullName To get My.Current.Class But what can I call
My current solution consists of several Class Libraries and a Website. I'm in the
The current version of hadoop-streaming requires a Java class for the combiner, but i
In my current project I noticed that all class fields and variable inside methods
I reference the current page in a class with Page page = HttpContext.Current.CurrentHandler as
As part of my current project I've created a custom class loader. Part of

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.