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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:14:09+00:00 2026-06-14T21:14:09+00:00

Using this jquery code I am trying to change the display from none to

  • 0

Using this jquery code I am trying to change the display from none to block for the
second ul under Sale which is under Belts (It has a belts-1 href). The below code
should be accessing the second element but its not. What am I doing wrong?

$currentCategory = "Belts";
$(".sideCatMenu a:contains('" + currentCategory + "') ul").next(ul).eq(2).css('display', 'block');

I am searching this list

<li class="active"><a href="/sale/" class="parentSide">Sale</a><ul style="display: block;" class="subcat">
<li><a href="/accessories-3/">Accessories</a><ul style="display: none;">
<li><a href="/bags-1/">Bags</a></li>
<li><a href="/wristbands/">Wristbands</a></li>
<li><a href="/dog-collars/">Dog Collars</a></li>
<li><a href="/wallets/">Wallets</a></li>

</ul>
</li>
<li><a href="/ten-dollar-buckles/">Ten Dollar Buckles</a></li>
<li><a href="/belts-1/">Belts</a><ul style="display: none;">
<li><a href="/28-belts/">28" Belts</a></li>
<li><a href="/30-belts/">30" Belts</a></li>
<li><a href="/32-belts/">32" Belts</a></li>
<li><a href="/34-belts/">34" Belts</a></li>
<li><a href="/36-belts/">36" Belts</a></li>
<li><a href="/38-belts/">38" Belts</a></li>
<li><a href="/40-belts/">40" Belts</a></li>
<li><a href="/42-belts/">42" Belts</a></li>
<li><a href="/44-belts/">44" Belts</a></li>
<li><a href="/46-belts/">46" Belts</a></li>
<li><a href="/48-and-larger-belts/">48" and Larger Belts</a></li>

</ul>
</li>

</ul>
</li>
  • 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-14T21:14:11+00:00Added an answer on June 14, 2026 at 9:14 pm

    1 – Your anchor doesn’t have ul child so:

    $(".sideCatMenu a:contains('" + currentCategory + "') ul")
    

    Doesn’t select any element, it should be:

    $(".sideCatMenu a:contains('" + currentCategory + "')")
    

    2 – You should wrap the ul with quotation marks:

    next('ul')
    

    3 – next only selects one element, so using eq in your code doesn’t make sense.

    4 – In you code currentCategory is undefined as you have a variable named $currentCategory not currentCategory.

    Well, let’s try this:

    $(".sideCatMenu a:contains('"+$currentCategory+"')").next('ul').show()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to execute jQuery code when a div's style changes from display: none;
Hi I found the following code from this page JQuery UI DatePicker using 2
I'm using a tutorial plugin - http://particlebits.com/code/jquery-tutorial/ which has this code attached to the
Using this jquery code: <a href=javascript:void(0) id=m1>Get Selected id's</a> jQuery(#m1).click( function() { var s;
I'm using this jquery code to show and hide divs on my page. As
I'm using this plugin for jquery called resize-crop: http://code.google.com/p/resize-crop/ The problem with this is
how can we save dragged item with cookies. I'm using Jquery with this code
Im using jquery 1.3.2 and this is the code: <script type=text/javascript> //<![CDATA[ jQuery(function(){ jQuery('.news_bullet
i using jquery and jquery-ui, this is my code: <!DOCTYPE HTML PUBLIC -//W3C//DTD HTML
How to make this css code cross browser compatible using jquery. this code only

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.