views:

39

answers:

4
<table>
    <tr class="myRow"><td class="col1"></td><td class="col2"></td></tr>
    <tr class="myRow"><td class="col1"></td><td class="col2"></td></tr>
    <tr class="myRow"><td class="col1"></td><td class="col2"></td></tr>
    <tr class="myRow"><td class="col1"></td><td class="col2"></td></tr>
    <tr class="myRow"><td class="col1"></td><td class="col2"></td></tr>
</table>

How do I make the appropriate col1 fill with the letters "ABC" when the user rollovers the row?

And then disappear the "ABC" when the user moves the mouse away from that row?

So far, I got this. I solved it.

  $(".ep").hover(function(){
        $(this).find('td.playButtonCol').html('PLAY');
    },function(){
        $(this).find('td.playButtonCol').html('');
    });
+1  A: 

Use the mouseenter and mouseleave events.

$('.col1').mouseenter(function(){ ... });
$('.col1').mouseleave(function(){ ... });
Jeremy
A: 

you means something like this?:

$('.col1').hover(function() {
    $(this).html('ABC');
}, function() {
    $(this).html('');
});
Amr ElGarhy
+1  A: 
    $(".col1").hover(
function(){
 $(this).html = ('abc');
    )};
Vafello
+1  A: 

Your question is a little vague but if I understand you correctly you want to hover over a row and put a value in one particular cell in that row. If so, that's relatively easy:

$("tr").hover(function() {
  $(this).children(".col1").html("ABC");
}, function() {
  $(this).children(".col1").html("");
});
cletus