jQuery highlight row with checkbox click
jQuery highlight row with checkbox click
$(document).ready(function(){
$("table tr td input").click(function() {
if ($(this).attr("checked") == true)
{
$(this).parent().parent().css('background-color', '#FFFF99');
}
else
{
$(this).parent().parent().css('background-color', '#FFFFFF');
}
});
});
If you want to hide select box when none of checkbox selected:
$(document).ready(function(){
$("#select_hold").hide();
$("table tr td input").click(function() {
if ($(this).attr("checked") == true)
{
$(this).parent().parent().css('background-color', '#FFFF99');
}
else
{
$(this).parent().parent().css('background-color', '#FFFFFF');
}
});
$("#hold input").click(function() {
if($("input:checked").length)
$("#select_hold").show();
else
$("#select_hold").hide();
});
});

Post a Comment