(this) has to stand alone, you can't use it quite the same way as parent child in your selector


most common way to do it is $("this").find("td").css(......); ///looks for td's that are children of (this)

or there's an abbreviated method that isn't shown in many examples

$("td", this).css(...)


Coxy wrote:
$('.mainTable > tbody > tr').bind("mouseover", function(){
	// alert('hi');
	//$(this + ' > td').css('background', '#ff0000'); // Didn't work
	$(this + ' td').css('background', '#ff0000'); // Doesn't either
});

I want to highlight td's in a row when I mouse over the TR's. I set
the mouseover function using the above code. The alert works when I
mouse over the row, so I then tried to select the TD children and
change their bg but it then does nothing.

Did I use this incorrectly? I'm new to jQuery and am still getting
used to the selectors.

Thanks for any advice.


  

Reply via email to