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

  • Home
  • SEARCH
  • 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 4029182
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:18:47+00:00 2026-05-20T11:18:47+00:00

The requirement is when i click on a text field, a table has to

  • 0

The requirement is when i click on a text field, a table has to display below the text field and when i move my mouse over the rows, the rows must be highlighted – what am I doing wrong in my code?

My HTML has 2 elements:

<input type="text" id="name" value="Name"><div id="line"></div>

The CSS is:

.datahighlight {
        background-color: #ffdc87 !important;
}

And the jQuery is:

jQuery(document).ready(function($){

    $("#name").click(function(){
        $("#line").html("<table><tbody><tr class='simplehighlight'><td>Text Row to be highlighted</td></tr></tbody></table>");

    });

    $('.simplehighlight').hover(function(){
            $(this).children().addClass('datahighlight');
        },function(){
            $(this).children().removeClass('datahighlight');
        });


});
  • 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-20T11:18:48+00:00Added an answer on May 20, 2026 at 11:18 am

    You should use the jQuery ‘live’ bindings. Try this:

    $('.simplehighlight').live('mouseover', function() {
        $(this).children().addClass('datahighlight');
    }).live('mouseout', function() {
        $(this).children().removeClass('datahighlight');
    });
    

    Here is a jsFiddle: http://jsfiddle.net/LsDGZ/

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

Sidebar

Related Questions

A form has a input field which would contain text values . There is
My requirement is on clicking a (+) button, the rows in the table should
I have a requirement adding/deleting table rows dynamically using jquery. I have a table
The requirement is to show some text in a pdf which has a hyperlink
Current requirement is on button click I am getting a json data through ajax
I want to change class on click on a tag. The requirement is when
my form consists of following elements: icefaces text field to enter search criteria. icefaces
I have an Email Id text box. My requirement is that an user enters
I have requirement of creating/splitting my div elements horizontally and vertically on click of
I was looking at adding rows dynamically to my HTML table using jQuery with

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.