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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:44:19+00:00 2026-06-09T18:44:19+00:00

i have this code $.getJSON(‘check.php’, function(data) { $.each(data, function(key, val) { $(#badge).append(<tr><td>+val+</td></tr><tr><td>——————————————————-</td></tr>); }); });

  • 0

i have this code

$.getJSON('check.php', function(data) {
    $.each(data, function(key, val) {  
        $("#badge").append("<tr><td>"+val+"</td></tr><tr><td>-------------------------------------------------------</td></tr>");
    });
});

$("td").mouseover(function () {
    $(this).css("color","red");
});

my problem is when i hover my mouse cursor on each element they will not change color as what i expected… can someone explain me why??? and help me how to do the right thing.

  • 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-09T18:44:20+00:00Added an answer on June 9, 2026 at 6:44 pm

    The event mouseover will not fire as the element is not present on page on load … so you need to do this :

    $("#badge").on('mouseover','td', function () {
        $(this).css("color","red");
    });
    

    The on() functions will be triggered on the badge element (which is a table im guessing) and will only trigger when the event target is a td and the event is mouseover.

    One thing to note though – this could easily be done with css :

    #badge td:hover {
       color: red;
    }
    

    Thanks @WTK :

    Keep in mind, that on() is available starting jQuery 1.7. For older versions of jQuery and similar outcome use either bind(), delegate() or live().

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

Sidebar

Related Questions

I have this code: var myRSS =[]; function rssReader() { $.getJSON('bbc.php', function(data){ console.log(data); $.each(data[0].channel.item,
I have this code: $.getJSON(Featured/getEvents, function(data){ $.each(data.events, function(i,event){ var title = event.title.substr(0,20); $(#title-+i).text(Text); if
I have the following jquery code: jQuery(function(){ jQuery(select#rooms).change(function(){ var options = ''; jQuery.getJSON(/admin/selection.php,{id: jQuery(this).val(),
I have this code: $.getJSON('http://www.reapp.se/cmesapp/cmes.json?callback=?', function(data){ alert(disco); }).error(function() {alert(fail!;}); Which is sending out an
I have this code: $.getJSON('../encomendasanexos.php?campo=idencomendas&nome=imagem&id='+id_int, function(registro){ var imghtml = []; imghtml = '<img src=icones/editar.png
I have this code which reads the JSON data: $.getJSON(data.json, function(data){ var output =
I have this piece of code: $.getJSON('http://domai.nr/api/json/search?q='+encodeURI(d.val())+'&callback=?','',function(data){...}); But I'm seeing this in my Google
I have this code: $('#find').click(function(){ if(first.val() != '' && second.val() != ''){ $.getJSON(urlPersonSearch +
i have this jquery code $(#eioShowLink).on('click',function(){ $(#ioEditRelatedConcepts).html(''); $.getJSON(http://localhost/Mar7ba/Ontology/getRelatedConceptsAndRelations/+conceptName+/TRUE, function(data){ var concepts = data[0]; var
Using this code $.getJSON(http://mydomain.com/getcustomers?callback=?,function(data) { .... }).error(function(err){ .... }) I'm getting jQuery16103492487950357067_1336742910384 was not

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.