This article mainly introduces the usage of the gt selector in jQuery. The example analyzes the functions, definitions, and matching skills of the gt selector that are greater than the given index value, which has some reference value, for more information about how to use the gt selector in jQuery, see the following example. Share it with you for your reference. The specific analysis is as follows:
This selector matches all elements whose index values are greater than the given index values.
The minimum index value starts from 0.
Syntax structure:
The Code is as follows:
$ (": Gt (index )")
This selector should also be used with other selectors, such as class selector and element selector. For example:
The Code is as follows:
$ ("Li: gt (0)" ).css ("color", "blue ")
The above Code sets the font color of the li element with an index greater than 0 to green.
If it is not used with other selectors, the default state is to use with the * selector. For example, $ (": gt") is equivalent to $ ("*: gt ").
Parameter List:
Parameters |
Description |
Index |
Given index value |
Instance code:
The Code is as follows:
Foot home