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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:49:34+00:00 2026-06-11T14:49:34+00:00

The following opens the first tab upon document being ready. I simply want to

  • 0

The following opens the first tab upon document being ready.
I simply want to keep this functionality but would like to add a constraint:
if the parent Li class is hidden, don’t do it. If this is too complex, I could also add a class to <a/> and say if it is of this type then don’t do it.

<ul id="attached_deals_tab" class="nav nav-tabs">
   <input id="id_deals-0-id" type="hidden" name="deals-0-id">
   <li class="hidden">
       <a data-toggle="tab" href="#X">X</a>
    </li>
</ul>


$('#attached_deals_tab').find('a:first').tab('show');

Would that be even possible?

  • 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-11T14:49:35+00:00Added an answer on June 11, 2026 at 2:49 pm

    Assuming the a:first is inside the first li that is visible you could just do this:

    $('#attached_deals_tab li:first:visible a:first').tab('show');
    

    If you absolutely wanted to do it depending on not having the class hidden then you can do:

    $('#attached_deals_tab li:not(.hidden) a:first').tab('show');
    

    And you can combine :first, :not, :visible etc.

    Another tip is to work your way towards the selector by trying bits of the jQuery selector from left to right and see if in Firebug, you’re finding the right elements in the dom.

    eg. just doing $('#attached_deals_tab li:not(.hidden)) in your Firebug console should return a dom object that you can just click to go to that element selected in HTML view.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hy , I have the following code for mai tabs ... $(document).ready(function() { $(#continut_right
Ok guys, this is my first thread, and I have searched online but with
In the following code snippet, if I go to the first open parenthesis (
The following javascript opens a pop-up in Firefox, Safari, IE, and Google Chrome: window.open(http://google.com,
I have the following code that opens a new popup window while disabling the
I found the following answer to that question: A service opens before you even
I have a tab-delimited text file that I am parsing. Its first column contains
I have an index page for listing products. From this page I would like
I want to stop other Thread s until the user provides input in this
I need a way of being able to do the following: A web application

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.