gt in jquery is a filter selector, used to obtain all elements greater than a given index (index) value, the syntax is "$(":gt(index)")"; this selector is commonly used Used with other selectors to select elements after a specific sequence number in a specified combination.
The operating environment of this tutorial: windows7 system, jquery1.10.2 version, Dell G3 computer.
"gt" is a filter selector in jquery, the full name is ":gt()
".
:gt() selector gets all elements that are greater than the given index (index) value, and the index number starts from 0.
Syntax:
$(":gt(index)")
index Required. Specifies the elements to be selected. Elements whose index value is greater than the specified number will be selected.
: The most common use of the gt() selector: used with other selectors to select elements after a specific sequence number in a specified combination (such as the example above).
Example:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="jquery-1.10.2.min.js"></script> </head> <body> <table style="width:100%" border="3"> <tr> <td>0</td> <td>1</td> <td>2</td> <td>3</td> <td>4</td> </tr> <tr> <td>5</td> <td>6</td> <td>7</td> <td>8</td> <td>9</td> </tr> <tr> <td>10</td> <td>11</td> <td>12</td> <td>13</td> <td>14</td> </tr> </table> <script> $("td:gt(8)").css( "backgroundColor", "lightgreen"); $("td:gt(3)").css( "color", "red"); </script> </body> </html>
Related video tutorial recommendation: jQuery Tutorial(Video)
The above is the detailed content of What is jquery's gt?. For more information, please follow other related articles on the PHP Chinese website!