How jquery hides the first tr
This article mainly explains "how jquery hides the first tr". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how jquery hides the first tr.
Hiding method: 1, use ": first" selector to get the first tr element, syntax "$(" tr:first ")"; 2, use hide () or fadeOut () to hide the acquired tr element, syntax "tr element .hide" or "tr element .fadeOut (millisecond value)".
The operating environment of this tutorial: windows7 system, jquery1.10.2 version, Dell G3 computer.
Tr element
Tags define rows in the HTML table.
An element contains one or more or elements.
Jquery's method of hiding the first tr
The idea of realization is:
Get the first tr element of the table
Hide the acquired tr element
Implementation method:
You can use: first selector to get the first tr element
You can use the hide () or fadeOut () method to hide the selected element
Implementation code:
$(document) .ready (function () {$("button") .on ("click", function () {$("tr:first") .hide (1000); / / $("tr:first") .fadeOut (1000) );}) Commodity price T-shirt ¥100 cowboy coat ¥250 jeans library ¥150
Hide the first tr
At this point, I believe you have a deeper understanding of "how jquery hides the first tr". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!