I have a problem that I can not solve how much I try. By clicking the "Change Customer" button, I will not get the value from the CustomerNr cell. My problem is that I don’t know how to get the row index by clicking on the button, and then pass it to my function, so that I can specifically get CustomerNr in that row, which I clicked on. You can take a look at my jsfiddle link and note that this is the first time I have code in Javascript / JQuery. I am open to smart decisions.
Here you can see how far I have come. I managed to select a value from a specific cell.
function GetCellValues() {
var Row = document.getElementById("somerow");
var Cells = Row.getElementsByTagName("td");
alert(Cells[0].innerText);
}
I managed to get the row index by clicking on td , but I want to get it by clicking the button.
function myMethod(obj) {
alert(obj.parentNode.rowIndex);
}
- , #. ( #)
function GetCellValues(e) {
alert(Cells[0].Rows[e] innerText);
}
http://jsfiddle.net/6srjc7qL/