I did a lot of research but can’t find a solution for this.
How could i get email cell value when i click on the button which is located at the last cell of the same row.
Please check this screenshot for better understanding what i mean
So when i click Button 1, i wanna get Email1 value or when click Button 2, i wanna get N2 cell value.
I found this function but it return the clicked cell value not the one i need:
`
function getElementID(){
var tbl = document.getElementById("Results");
if (tbl != null) {
for (var i = 0; i < tbl.rows.length; i++) {
for (var j = 0; j < tbl.rows[i].cells.length; j++)
tbl.rows[i].cells[j].onclick = function () { getval(this); };
}
}
function getval(cel) {
alert(cel.innerHTML);
}
}
`
Any help is really appreciated
I found this function but it return the clicked cell value not the one i need:
`
function getElementID(){
var tbl = document.getElementById("MyTable");
if (tbl != null) {
for (var i = 0; i < tbl.rows.length; i++) {
for (var j = 0; j < tbl.rows[i].cells.length; j++)
tbl.rows[i].cells[j].onclick = function () { getval(this); };
}
}
function getval(cel) {
alert(cel.innerHTML);
}
}
`