So basically my php file will return an echo (as a table), and in that table, each row will have a cell that is a delete button to delete that row. whatI want is when button clicked, the row will be delete from table. So I guess the row index is important to implement this. But how can I get row index in this situation in javascript?
node.parentNode.removeChild(node), including table rows. Note that the parent of a row is always a table section element (tbody, thead, tfoot), not the table element.