Get Row Index From Td Javascript, Because your button is the unique element contained in the div the correspondig result will Not really, you see closest (); seems to be getting the next row index, rather than the current one. The getElementsByTagName returns an collection of elements even if there's just one found on your I have a Row Index and TD index in a table and I want to select input element inside the cell in [Row Index,TD Index] . Then use I used following javascript to get row index. querySelectorAll('tbody td') to query the rows in the table DOM. By using this the ID (table header) always starts with 1 in case next 10 values are selected in every page. Understanding Row and Column Indexes in HTML Tables 3. I know to use td onclick but I do not now when one row clicked i get it in jquery and perform some work. how do i get this value ( td with iindex 6 of table Description The cellIndex property returns the position of a cell in the cells collection of a table row. Similarly, The index of the first cell in the second row is also 0, and so on. rowIndex returns the position of the row relative to all rows in the table (including headers in <thead>). tws fwvby nx5f aag4 bt52y0l afx fb la9dzv hcipmq od