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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:48:00+00:00 2026-06-13T02:48:00+00:00

i built a big table,and i want to iterate through some classes name on

  • 0

i built a big table,and i want to iterate through some classes name on it to use a jquery effect(slideToggle),but when i tried to make a loop via For,nothing occur

html:

         <tr>
                        <td dir="ltr"><a href="">array_push()</a></td>
                        <td>اضافة عنصر او أكثر لنهاية المصفوفة</td>
                        <td>530</td>
                        <td class="example2">12.5</td></td>
                        <td>12.5</td>

                </tr>

         <thead>
        <tr> 
        <th colspan="5" rowspan="3" class="slide2" >
       <pre class="prettyprint lang-php ">
$a=array("Dog","Cat");
array_push($a,"Horse","Bird");
print_r($a);

       </pre>
        </th>
        </tr>
        </thead>

i want iterate through class name (example,slide) to take a number like example1,example2…………….

jquery:

$(document).ready(function(){
    for (var i=1;i<=120;i++){
    $(".example[i]").click(function(){


        $(".slide[i]").slideToggle(500);

        })

    }

    })
  • 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-13T02:48:02+00:00Added an answer on June 13, 2026 at 2:48 am

    I think you are not appending the index to the class. Look at the below code:

    $(document).ready(function(){
        for (var i=1;i<=120;i++){
        $(".example" + i).click(function(){
          $(".slide" + i).slideToggle(500);
        })
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to perform a big insert statement on multiple lines, but recursion is
link text I want to use the TIFF IFilter built in to Windows 2008
I built a website which runs on localhost and is pretty big by now.
My server doesnt allow upload/download of big files. On the other hand, I built
I want to build a MouseDragScrolling like Android over Java for a big touch
I built a website and then deploy it on the server. But when i
I have a big table with vertical scroll bar. I would like to scroll
The big question is are there any built in SQL Server 2005 functions to
I have built my database design and diagram. Now i want to build a
I'd like to work on a project, but it's a little odd. I want

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.