I have a autocomplete box in my aspx page, and from the list if I select any data, am binding the values into a div like this,
var data = "<div class='close'><table><tr><td rowspan='4' width='50px;'>
<img src='" + studentItem.Photo + "' Width='48' Height='48' /></td><td>"
+ studentItem.Name + " ( <span class='stuId'>" + studentItem.StudentId
+ "</span> )</td><td align='right' ><div class='close16'/></td></tr>
<tr><td><table cellpadding='0' cellspacing='0'><tr><td>"
+ studentItem.Email + "</td><td> | </td><td>"
+ studentItem.Mobile + "</td></tr></table></td></tr></table></td></tr>
</table></div>";
and am binding the datas into a div like
$("#students").append(data);
and I can delete particula data like
$(document).on('click', '.close16', function () {
$(this).parentsUntil('#students').remove();
});
here what I want to do is if I click delete(close16), I need to get the corresponding studentId(which is in the stuId ie. span)
I tried like alert($("stuId").text()); within the click event of close16, but its not showing anything, can anyone help me here, thanks in advance
1 Answer