Answers for "removing specific row with button html"

0

remove table line button html using javascript

// JQuery solution!
$('table').on('click', 'input[type="button"]', function(e){
   $(this).closest('tr').remove()
})
Posted by: Guest on November-06-2020
0

removing specific row with button html

function deleteRow(r) {
    var i = r.parentNode.parentNode.rowIndex;
    document.getElementById("myTable").deleteRow(i);
}
Posted by: Guest on November-20-2020
0

removing specific row with button html

<!DOCTYPE html>
<html>
<head>
<style>
table, td {
    border: 1px solid black;
}
</style>
</head>
<body>

<table id="myTable">

<tr>
  <td>Row 1</td>
  <td><input type="button" value="Delete" onclick="deleteRow(this)"></td>
</tr>
<tr>
  <td>Row 2</td>
  <td><input type="button" value="Delete" onclick="deleteRow(this)"></td>
</tr>
<tr>
  <td>Row 3</td>
  <td><input type="button" value="Delete" onclick="deleteRow(this)"></td>
</tr>
</table>
</body>
</html>
Posted by: Guest on November-20-2020

Code answers related to "removing specific row with button html"

Browse Popular Code Answers by Language