JQuery: gt selector, jQuery: gt Selector

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.