jQuery eq() 方法

jQuery 教程 · 2019-03-28 05:57:56

实例

选取第二个 <p> 元素(索引号为 1):

$("p").eq(1).css("background-color","yellow");

定义和用法

eq() 方法返回带有被选元素的指定索引号的元素。

索引号从 0 开头,所以第一个元素的索引号是 0(不是 1)。

语法

$(selector).eq(index)

参数 描述
index 必需。规定元素的索引。可以是整数或负数。

注意:使用负数将从被选元素的结尾开始计算索引。

点击查看所有 jQuery 教程 文章: https://www.codercto.com/courses/l/35.html

查看所有标签

Compilers

Compilers

Alfred V. Aho、Monica S. Lam、Ravi Sethi、Jeffrey D. Ullman / Addison Wesley / 2006-9-10 / USD 186.80

This book provides the foundation for understanding the theory and pracitce of compilers. Revised and updated, it reflects the current state of compilation. Every chapter has been completely revised ......一起来看看 《Compilers》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具