How to use jQuery screening method
This article mainly introduces how to use the jQuery screening method, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
Poetry fairy-Li Bai autumn breeze is clear, autumn Yueming fallen leaves gather and scatter, jackdaws are surprised to meet each other and know when? At this time this night embarrassed into my Acacia door, know that I Acacia bitter long Acacia, long memory, short Acacia, infinitely early know so tripping hearts Why don't you know $(function () {/ / 1) in the first place. The sibling element siblings, except for its own element, all siblings $("ul. Item"). Siblings ("li"). Css ("color", "green"); / / 2. Nth element / / (1) selector method $("ul li:eq (2)") .css ("color", "red") / / (2) method of selection (recommended) $("ul li"). Eq (2). Css ("color", "blue"); / / 3. Determine whether there is a class name console.log ($("ul li"). HasClass ("item");}) Thank you for reading this article carefully. I hope the article "how to use jQuery screening methods" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!