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 tr rows

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article introduces the knowledge of "how jquery hides tr". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Hiding method: 1, use "$(" tr:nth-child (n) ") to select the tr element of the specified line, parameter n specifies the number of lines; 2, use hide () or fadeOut () to hide the acquired tr element, syntax" tr element .hide (millisecond value) "or" tr element .fadeOut (millisecond value) ".

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

Jquery's method of hiding a row of tr

Implementation method:

Use the $("tr:nth-child (n)") statement to select the tr element of the specified row

Use the hide () or fadeOut () method to hide the selected tr element

Implementation example:

Hide the first line of tr elements

$(document) .ready (function () {$("button"). On ("click", function () {$("tr:nth-child (1)"). Hide (1000); / / $("tr:nth-child (1)"). FadeOut (1000) );}) Commodity price T-shirt ¥100 cowboy coat ¥250 jeans library ¥150

Hide the first tr

Hide the second line tr element

$(document) .ready (function () {$("button") .on ("click", function () {/ / $("tr:nth-child (2)") .hide (1000); $("tr:nth-child (2)") .fadeOut (1000) );}) Commodity price T-shirt ¥100 cowboy coat ¥250 jeans library ¥150

Hide the second line tr

This is the end of the content of "how jquery hides tr". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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: 245

*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