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

The Archive Base Latest Questions

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

I want to create a list with incremented ids and hrefs using jQuery. Is

  • 0

I want to create a list with incremented ids and hrefs using jQuery. Is this possible?

<ul id="links">
  <li><a href="#item1">Item number 1</a></li>
  <li><a href="#item2">Item number 2</a></li>
  <li><a href="#item3">Item number 3</a></li>
  <li><a href="#item4">Item number 4</a></li>
  <li><a href="#item5">Item number 5</a></li>
</ul>

<div id="toShow">
    <div id="item1" style="display:block;"></div>
    <div id="item2" style="display:none;"></div>
    <div id="item3" style="display:none;"></div>
    <div id="item4" style="display:none;"></div>
    <div id="item5" style="display:none;"></div>
</div>

These list items will be generated via a loop and I want to use this plugin http://www.bijusubhash.com/demo/show-hide-a-div-at-a-time-with-jquery/

Thanks,
David

  • 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-03T14:38:40+00:00Added an answer on June 3, 2026 at 2:38 pm

    I can assume that: What you need actually is much more simpler than you think:

    demo link

    HTML: (yes, NO custom ID’s mess)

    <ul id="links">
      <li><a href="#">Item 1</a></li>
      <li><a href="#">Item 2</a></li>
      <li><a href="#">Item 3</a></li>
      <li><a href="#">Item 4</a></li>
      <li><a href="#">Item 5</a></li>
    </ul>
    
    <div id="toShow">
        <div>First element</div>
        <div>Second element</div>
        <div>Third element</div>
        <div>Fourth element</div>
        <div>Fifth element</div>
    </div>
    

    And a couple of jQuery lines:

    $('#toShow>div:gt(0)').hide(); // hide all but first
    $('#links li').on('click',function(e){
        $('#toShow>div:eq('+$(this).index()+')').show(1700).siblings('div').stop(1).hide(1700);
        return false;
    });
    

    More info:
    http://api.jquery.com/

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

Sidebar

Related Questions

I want to create list view just like this: http://dl.maximumpc.com/galleries/androidpower/Alarm_full.jpg I need to create
I want to create a list of category terms (contained within a block), with
I want to create a list of GridBagPanel.Constraints . I read it in the
I`v come across a need where I want to create multiple list items from
Sorry for the Newb-ness. I want to create a list of view elements in
I want create module which update list of usb devices automatically (not only mass
I want to create a dropdown list with a list of spoken languages (English,
I want to create a custom list in Flex for an interface prototype. The
My Goal: i want to create an horizontal list of images. when mouse is
I want to create a large (~300,000 entries) List of self defined objects 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.