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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:34:36+00:00 2026-05-27T08:34:36+00:00

I have search the previous question but couldn’t find the answer. Dynamically generated html:

  • 0

I have search the previous question but couldn’t find the answer.

Dynamically generated html:

<a class="finddiv" id="#div_0">date1</a>
<a class="finddiv" id="#div_1">date1</a>
<a class="finddiv" id="#div_2">date1</a>

hidden div which i have to open- on cllick of above link:

<div id="div_0" style="display:none;"></div>

<div id="div_1" style="display:none;"></div>

<div id="div_2" style="display:none;"></div>

I want to open the div with id div_o by clicking of anchor tag with class name find, I am using the following jquery:

$(document).ready(function() {
    $('a.find').delegate(this, 'click', function() {
        var ids = $(this).attr('id');
        $(ids).slideToggle();
        return false;
    });
    return false;
});

But above function is running as many time as the number of elements in the class “find”.
In above case 3 times. I just want to run the function once. I have also used “one”, “live”
properties in jquery but nothing has happened. Since the content is dynamic I can not use the id attribute to call jquery function.

  • 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-27T08:34:37+00:00Added an answer on May 27, 2026 at 8:34 am

    You have your delegate mixed up:

    $(document).delegate('a.finddiv', 'click', function(){
        $(this.id).slideToggle();
        return false;
    });
    

    Demo: http://jsfiddle.net/AndyE/AZCky/

    Attaching like this also means you don’t need to place it inside $(document).ready().

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

Sidebar

Related Questions

I have search through the web to figure this out but no luck. I
The question raised from the question here . In order to have search engines
(This question is related to my previous question , or rather to my answer
My previous question pertained to the general string search algorithm. I am researching the
This is similar to a previous question , but the answers there don't satisfy
I have a search form on a previous page where I allow users to
Hi I'm having trouble implenting an answer to a previous question // on calling
This question may seem stupid, but, so be it! I have a stupid problem
I have search in MSDN and I can't figure where are the POST parameters
I have search strings, similar to the one bellow: energy food olympics 2010 Terrorism

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.