Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of deleting tr element by javascript

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report