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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:58:02+00:00 2026-05-14T02:58:02+00:00

I dynamically added rows to a table but it doesn’t seem to take hover

  • 0

I dynamically added rows to a table but it doesn’t seem to take hover effects given in jquery…

Here is my code,

 <table  id="chkbox" cellpadding="0" cellspacing="2" width="100%" class="table_Style_Border">
        <tr>
            <td style="width:150px" class="grid_header" align="center">RackName</td>    
            <td style="width:150px" class="grid_header" align="center">LibraryName</td>  
            <td style="width:200px" class="grid_header" align="center">LibrarianName</td>
            <td style="width:200px" class="grid_header" align="center">Location</td>
            <td style="width:1%" class="grid_header"></td>


        </tr>

         <? if(isset($comment))
               { echo '<tr><td class=table_label colspan=5>'.$comment.'</td></tr>'; } ?>
        <?php foreach($rackData as $key =>  $row) { ?>
        <?php printf('<tr  class="%s">', ($key % 2) ? 'rowcolor' : 'alternaterowcolor'); ?>
            <td align="left" class="table_label">
                    <?=$row['rack_name']?>
            </td>
            <td align="left" class="table_label">
                    <?=$row['library_name']?>
            </td>
            <td align="center" class="table_label">
                    <?=$row['librarian']?>
            </td>
            <td align="center" class="table_label">
                    <?=$row['location']?>
            </td>
            <td align="center">
                <input type="checkbox" name="group" id="group" value="<?=$row['rack_id']?>" onclick="display(this);"  > 
            </td>

        </tr>

<?  } ?>


        </table><div align="right" class="pagination"> <?php /*?><?php echo $links;?><?php */?></div>
<script type="text/javascript">
$("#chkbox").hover(function() {
  $(this).addClass("resultshover");
}, function() {
  $(this).removeClass("resultshover");
});
</script>
  • 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-14T02:58:02+00:00Added an answer on May 14, 2026 at 2:58 am

    Your code looks correct for the most part, but I believe the problem is you must call your Javascript in the $(document).ready() function, like this:

    $(document).ready(function() {
        $('#chkbox tr').hover(function() {
            $(this).addClass('resultshover');
        }, function() {
            $(this).removeClass('resultshover');
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table. Some rows are dynamically added by jquery. The first <td>
How can I count the table rows that is added dynamically with jQuery? I
I'm using jQuery to dynamically add rows to my HTML table on a button
hello i am having a problem with dynamically added rows to jquery tablesorter, i
I have a jsp page in which rows of a table are added dynamically.
i added checkboxes dynamically to panel. for (int intControlIndex = 0; intControlIndex < dsTagsList.Tables[0].Rows.Count;
I am having a TableLayout for which I added rows dynamically. In each of
I added onkeyup javascript for a dynamically added textbox in javascript... But it doesnt
If buttons are dynamically added in wpf from code behind how can you add
I have an html table with a few rows, I have included a jquery

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.