I have a table with alternate color rows.
$("#contTbl tr:even").addClass("altBgr");
Than I have a function that does some transaction and after AJAX post it removed the row.
$(".clickMe").click(function() {
var trID = $(this).closest("tr").attr("id");
$.ajax({
url: "ajax.php",
type: "POST",
data: {
contID: trID
},
success: function(data){
$("#"+trID).remove();
}
});
});
The problem that I have is when I remove a row, the color of the other rows becomes out of order… Is there a way to refresh it somehow on remove?
What about removing the
classon the click and adding it back on the success retrieval?Edited: as per my own comment