Created
July 10, 2014 23:24
-
-
Save jikeytang/5c0e699d88111bc61348 to your computer and use it in GitHub Desktop.
[ jQuery ] - 20140711-题目1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
请说出以下的区别: | |
1. $('p').get(), | |
2. $('p')[1], | |
3. $('p').eq(0), | |
4. $('p').index() | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$('p').get()
获取文档所有p标签元素的数组
$('p')[1]
获取文档第二个p标签元素
$('p').eq(0)
获取文档第一个p标签元素的jQuery对象
$('p').index()
获取文档最后一个p标签元素相对于其第一个兄弟节点的位置
Demo演示