hey,
the code i written is displays me the number of time i click on it here is the code
the code i written is displays me the number of time i click on it here is the code
Code:
$(document).ready(function () {
//assigning alternative row style
$("#Table_Data tr:even").addClass("evenrow");
$("#Table_Data tr:odd").addClass("oddrow");
$("#Table_Data tr:even").click(function(){
$(this).find(':checkbox').attr('checked', ! $(this).find(':checkbox').attr('checked'));
if($(this).find(':checkbox').attr('checked'))
{
var html = '';
$('#Table_Data td').bind("click",function(event) {
html = $(this).text();
alert(html);
$(this).unbind(event)
});
}
else
{
$(this).removeClass('highlight');
$(this).addClass('evenrow');
}
});
$("#Table_Data tr:odd").click(function(){
$(this).find(':checkbox').attr('checked', !$(this).find(':checkbox').attr('checked'));
if($(this).find(':checkbox').attr('checked'))
{
$('#Table_Data td').click(function() {
html = $(this).text();
alert(html);
});
/** $(this).removeClass('oddrow');
$(this).addClass('highlight');*/
}
else
{
$(this).removeClass('highlight');
$(this).addClass('oddrow');
}
});
});
Comment