JS gets information about the row in which the button cell was clicked

  • 2020-03-30 03:22:45
  • OfStack

Click the button in a cell in the table with JS to get the information of the row:
 
function GetRowNo() { 
var e = e || window.event; 
var target = e.target || e.srcElement; 
if (target.parentNode.tagName.toLowerCase() == "td") { 
rowIndex = target.parentNode.parentNode.rowIndex; 
} 
} 

Related articles: