How jquery hides tr rows
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!