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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:40:44+00:00 2026-05-15T03:40:44+00:00

I have a quick question of how I can use jQuery tabs (you click

  • 0

I have a quick question of how I can use jQuery tabs (you click on link button to display/hide certain divs). The div id matches the href of the link:

HTML links:

<table class='layout tabs'>
<tr>
  <td><a href="#site">Site</a></td>
  <td><a href="#siteno">Number</a></td>
</tr>
<tr>
  <td><a href="#student">Student</a></td>

  <td><a href="#school">School</a></td>
</tr>
</table>
</div>

div that needs to display/hide:

<div id="site">
  <table class='explore'>
    <thead class='ui-widget-header'>
      <tr>
        <th class=' sortable'>
          Site
        </th>

        <th class=' sortable'>
          Number
        </th>
        </tr>
        </thead>
        </table>
</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-05-15T03:40:44+00:00Added an answer on May 15, 2026 at 3:40 am
    $("table.tabs a").click( function() {
        var id = $(this).attr( "href" );
        var div = $(id);
        div.toggle();
    } );
    

    This will get you exactly what you’re asking. However, I suspect that you also want to hide all other divs when one div is shown. True?

    Ok, now that you’ve responded that it’s true, here’s your new code.
    You also should add a class (in my code – “tab-div”) to all your DIVs, in order to have them easily selectable all together.

    $("table.tabs a").click( function() {
        var id = $(this).attr( "href" );
    
        // Hide all the tab divs
        $(".tab-div").hide(); 
    
        // Then show the one that's been clicked
        $(id).show();
    } );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a quick question that I can't seem to find online. I am
I am hoping someone can help me out with a quick question I have
I have quick question about jQuery plugins, hope somebody out there has some advice.
quick question... I have a series of buttons, each with a tag. I click
I have a quick question i hope you guys can answer, i've got a
Working with JQuery Validator and just have a quick question. I'm using addMethod to
I have a quick question regarding the use of typedefs for lengthy templates. The
I have a quick question about mysql_real_escape_string. Where should I use it? I have
Quick question (quick deadline...I know I can use google). I'm writing a site on
I have a quick question about keyup with jquery. I have several form input

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.