JQuery: gt selector, jQuery: gt Selector
: Gt selector definition and usage:
This selector matches all elements whose index values are greater than the given index values.
The minimum index value starts from 0.
Syntax structure:
$(":gt(index)")
This selector should also be used with other selectors, such as class selector and element selector. For example:
$("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:
<! DOCTYPE html>
The above Code sets the font color of the li element whose index value is greater than 0 in the li element set to blue.
Example 2:
<! DOCTYPE html>
Because the above Code does not specify a selector used in combination with the: gt selector, it is used with the * selector by default, the above Code sets the font color of all elements whose index value is greater than 1 in the current document to blue.
Original address: http://www.51texiao.cn/jqueryjiaocheng/2015/0613/4200.html
The most original address is: http://www.softwhy.com/forum.php? Mod = viewthread & tid = 5362.