Reputation: 30855
onclick
, I need to
I'm having particular difficulty with the first part.
Upvotes: 0
Views: 570
Reputation: 3485
$('.grid input[type="checkbox"]').click(function(){
$(this).parent().css('background-color', 'red');
});
UPDATE (for attribute use)
function clickHandler() {
$(this).parent().css('background-color', 'red');
}
and then onclick='clickHandler()'
Upvotes: 3
Reputation: 76880
if you attach the event with jquery it's pretty easy
$('#yourid').click(function(){
var parent = $(this).parent();
parent.css("background-color", "red");
});
Upvotes: 1