Javascript: Supprimer une ou plusieures lignes d’une table

Author:

Javascript: Supprimer une ou plusieures lignes d'une table
Download

<html>
  <head>
 
  </head>
  <body>
    <html>
<head>
 
<script type="text/javascript">
function deleteRow(i){
    document.getElementById('myTable').deleteRow(i)
}
</script>
</head>
 
<body>
<table id="myTable" border="1">
<tr>
  <td>Paris</td>
  <td><input type="button" value="Supprimer" 
    onclick="deleteRow(this.parentNode.parentNode.rowIndex)"></td>
</tr>
<tr>
  <td>Madrid</td>
  <td><input type="button" value="Supprimer" 
    onclick="deleteRow(this.parentNode.parentNode.rowIndex)"></td>
</tr>
<tr>
  <td>Londre</td>
  <td><input type="button" value="Supprimer" 
    onclick="deleteRow(this.parentNode.parentNode.rowIndex)"></td>
</tr>
</table>
</body>
 
</html>
  </body>
</html>

Cet article Javascript: Supprimer une ou plusieures lignes d’une table est apparu en premier sur .