Some methods have been removed (tr is dynamically added), but they do not work. Later I found a good method. So I will share with you the following, one problem is that some tr is removed (tr is dynamically added ). The deleteRow method does not work if you try many methods. (For example, the deleteRow method does not work. It seems that the passed parameter can only be the number of lines of tr. Does not carefully study the current ). Later, I found this method works well and I would like to record it here.
$ (Temp ). parent (). remove (); // temp is the id code class = "js plain"> I understand this as follows: $ (temp) first obtains the td object, and then. parent () gets the tr of td, then remove () method, delete tr.
Html code:
Js Code:
Function removeTr (temp) {mp ). parent (). parent (). remove (); // you must ensure that jQuery has been introduced to the page before you can use it. // here $ (temp) gets the object first ,. parent () to get
123 |
456 |
Aaa |
Bbb |
;/Table>
, And then. parent () gets tr} |