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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:34:52+00:00 2026-06-05T20:34:52+00:00

I am new to jQuery. I have a dynamically generated row with unique ID’s.

  • 0

I am new to jQuery. I have a dynamically generated row with unique ID’s. I need to apply a jQuery function to each row.

My jQuery function starts immediately after the page is loaded instead of waiting for me to click.

<script type="text/javascript">
$(function popup() {
  $(this).hover(function() {
    $('div#pop-up').show();
  }, function() {
    $('div#pop-up').hide();
  });
});
</script>

I want the jQuery popup() function to do its thing when I click on the ‘tr’ row, and only affect that particular row.

<tr id="abc" onclick="popup()">
  <td>blah</td>
</tr>
<tr id="def" onclick="popup()">
  <td>blah</td>
</tr>
<tr id="ghi" onclick="popup()">
  <td>blah</td>
</tr>
  • 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-05T20:34:54+00:00Added an answer on June 5, 2026 at 8:34 pm

    Use a selector to specify which element(s) the function should apply to, and then pass that selection into the appropriate jQuery method:

    $('tr').click(
        function(){
            popup();
        });
    

    In the above the function popup() will be called only once someone clicks on a tr element (or its children, since the click will bubble).

    You could also use on(), if any of the tr elements are to be added dynamically following the initial DOMReady event:

    $('tbody').on('click','tr',function(){
        popup();
    });
    

    With on() the events are bound to the element closest to the dynamically-added elements, and the method is passed an event-type (click) and, optionally, a selector (tr), to determine which elements will trigger the function(s) found within the method.

    Though remember, depending on what element(s) you’re using for the pop-up, that an id can be used for only one unique element within the document.

    Reference:

    • The jQuery API selectors index.
    • on().
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have multiple <textarea> generated dynamically with jQuery (.append). When I append a new
I'm new to jQuery, familiar with PHP & CSS. I have nested, dynamically generated
I have multiple dynamically generated buttons with a class name of .button. Each of
I'm working on a website with Jquery tabs dynamically generated. Each tab has an
I'm working with jquery. I have an anchor tag that is generated dynamically in
I have a form generated dynamically with the method .append() of jQuery. I can
i'm new to jquery .I have problem in the following code .I saved it
I'm new to jQuery and have noticed someone go: var $this = $(this); Why
I am new to jQuery and have run into a problem. I have a
I am somewhat new to jQuery and I have a problem with something I

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.