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

How jquery hides table's tr

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces "how jquery hides the tr of table". In daily operation, I believe many people have doubts about how jquery hides the tr of table. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "how jquery hides the tr of table"! Next, please follow the editor to study!

Jquery hides the tr in table: 1, use the "$(" .tr class name ")" statement to get the object according to the specified class value; 2, use the hide () method to hide the obtained object, the syntax is "$(" .tr class name "). Hide ();".

The operating environment of this tutorial: windows7 system, jquery1.10.0 version, Dell G3 computer.

The method of hiding tr in table by jquery

1. Create a new html file, named test.html, to explain how jquery determines whether the element is visible. Within the test.html file, use the table,tr,td tag to create a table with six rows and two columns. For ease of viewing, set the 1px border for the table. In the test.html file, in the table table, set the class property of part of the tr to aa, and set the id of the last line to bb.

Within the test.html file, use the button tag to create two buttons, "hide tr" and "Show tr", respectively, as follows:

2. In the test.html file, bind the onclick event to the two button buttons. When the button is clicked, execute the "hiddentr ()" function and the "displaytr ()" function respectively.

In the js tag, create the hiddentr () function, the displaytr () function, in the hiddentr () function, get the tre line object with class as aa, use the hide () method to hide the tr, in the displaytr () function, get the tre line object with id as bb, and use the show () method to display tr.

Open the test.html file in the browser and click the button to see the effect.

After clicking hide tr

Create a test.html file. Within the file, use the table,tr,td tag to create a table with six rows and two columns. Create two button buttons at the same time to trigger the execution of the js function. In the js tag, create the hiddentr () function, the displaytr () function, in the hiddentr () function, get the tre line object with class as aa, use the hide () method to hide the tr, in the displaytr () function, get the tre line object with id as bb, and use the show () method to display tr.

At this point, the study of "how jquery hides the tr of table" is over. I hope to be able to solve your 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

Development

Wechat

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

12
Report