php – How To Perform A Hide With Ajax.

The difficulty in question is how to restore the id or class of the TH / TD where the code resides in a variable within a FOR that I am trying to explain with some pictures.

After searching the database, I can list all persons belonging to a family member.Insert here the description of the picture

Function search member (date) {
var receive_family_prontuary = date;
// console.log (receive_family_address);
$ .ajax ({
URL: baseUrl + "/ default / family-register / search-members / id /" + date,
Type: "GET",
Date: receive_family_prontuary,
Success: Function (s) {
// console.log (r);
var result = [];
var gradeSpare = [];
var guardId = [];
for (var i = 0; i <r.length; i ++) {
guarded [i+1] r[i].usu_membro;
Switch (r[i].tgp_grau_parentesco) {
Case 1:
grade spare[i+1] = & # 39; MOTHER & # 39;
break;

Case 2:
grade spare[i+1] = & # 39; PAI & # 39;
break;

Case 3:
grade spare[i+1] = & # 39; BROTHER & # 39;
break;

Case 4:
grade spare[i+1] = & # 39; SISTER & # 39;
break;

Case 5:
grade spare[i+1] = & # 39; SON & # 39;
break;

Case 6:
grade spare[i+1] = & # 39; DAUGHTER & # 39;
break;

Case 7:
grade spare[i+1] = & # 39; AVĂ” & # 39;
break;

Case 8:
grade spare[i+1] = & # 39; GRANDE & # 39;
break;

Case 999:
grade spare[i+1] = & # 39; OTHERS & # 39;
break;

Default:

break;
}
Result[i] = ""+
""+
""+
""+
""+

""+
""+

""+

"Choose a size:"+
"To edit"+

"
Your name: Type of relationship:
"+ r[i].usu_name + ""+ grade spare[i+1]+ "
"; } // console.log (result); for (var i = 0; i <result.length; i ++) { $ ("# family"). attach (result[i]); } } }) }

So I started to develop the part of the exclusion of the family member that worked and was already checked in the database by the function.

Function deleteMemberFamily (date) {
var receiveId = date;
var receiveClasseTH = $ (".name"). val ();
console.log (receiveClasseTH);
$ .ajax ({
url: baseUrl + "/ default / family-register / search-member / id /" + date,
Type: "GET",
Date: received,

Success: Function (Success) {
alert ("member deleted successfully!");
}

})
return false;
}

Now I want to delete the line matches, but I can not figure out how to retrieve the data from TD or TH. I have been asked to use data-rel, but I still can not get it to work.