traverse the row to get the appended itemid
I want to get the rowid so I can do the delete from MySQL after the AJAX.
but from my alert('itemid') I get "rowid is undefined"?
$(document).on('click','.circle',function(){
var rowid = $(this).closest('td').attr('itemid');
alert("the row id"+rowid);
$(this).closest("tr").remove();
return rowid;
});
I don't understand this because the AJAX function works and does append the item.id to the end before the closing</tr> So I must be traversing the row wrong ? In other words something is wrong with $(this).closest('td').attr('itemid'); because it is there and just can't find it.
Below is from HTML tab in Firebug and it has the itemid appended:
<div id="response">
<table id="table">