Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

The method of deleting tr element by javascript

Shulou Source: shulou.com Published: 2022-05-31 10:37:41 11月24日 Update

This article mainly introduces "the method of javascript deleting tr element". In the daily operation, I believe that many people have doubts about the method of deleting tr element by javascript. The editor consulted all kinds of data and sorted out a simple and easy-to-use operation method. I hope it will be helpful to answer the doubt of "javascript delete tr element". Next, please follow the editor to study!

Javascript deletes tr by first creating an HTML sample file, then defining the table table, and finally deleting the tr element through the "function delete2 (obj) {...}" method.

This article operating environment: windows7 system, javascript1.8.5 version, Dell G3 computer.

How does javascript delete tr?

Javascript deletes the tr element

Javascript

Function delete1 (obj) {var tr= OBJ [XSS _ clean] [xss_clean]; var tbody= trr [XSS _ clean]; tbody.removeChild (tr);} / / use Jquery to delete function delete2 (obj) {$(obj). Parent (). Parent (). Parent () [0] .removeChild ($(obj). Parent (). Parent () [0]);} / this method simply hides the TR element function hide (obj) {$(obj). Parent (). Parent (). Hide ();}

HTML

Xxx1 delete xxx1 delete xxx1 hidden here, on the "javascript delete tr element method" study is over, I hope to be able to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Elements methods learning more help practical next just files articles methods environment theory computers knowledge examples articles systems websites tables Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Xiaomi vpn Shulou Information MariaDB