JavaScript Reference/Javascript Methods/deleteRow

Материал из Web эксперт
Перейти к: навигация, поиск

"deleteRow()" Example

   <source lang="javascript">
   

<html> <body> <script language="JavaScript"> function function1() {

   document.all.myT.deleteRow(2);

} </script>

Row 1 Cell 1
Row 2 Cell 2
Row 3 Cell 3
Row 4 Cell 4

<input type="button" value="Remove Row 3" onclick="function1();"> </body> </html>


     </source>
   
  


"deleteRow()" is applied to

   <source lang="javascript">

Names noted with an asterisk (*) are JavaScript properties only. +----------------+--------------------------------------------------------------+

| Applied_To |rows* | | |<tbody> <tfoot> | | |<thead> | +----------------+--------------------------------------------------------------+ </source>

"deleteRow()" Syntax, Parameters and Note

   <source lang="javascript">

Note: Deletes a row from the rows collection, or

from a
, <tbody>, <tfoot>, or <thead> element. Syntax: document.all.tableID.rows[index].deleteRow(param1) document.getElementById("elementID").deleteRow(param1) document.all.elementID.deleteRow(param1) // IE only Parameters: param1 Optional; the row index in the rows collection. If omitted, the last row will be removed. </source>