六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 153|回复: 0

jquery学习笔记(4) DOM Manipulation

[复制链接]

升级  61.33%

40

主题

40

主题

40

主题

秀才

Rank: 2

积分
142
 楼主| 发表于 2013-2-7 19:56:53 | 显示全部楼层 |阅读模式
本文是Learning JQuery的学习笔记

1.attr(), removeAttr()

$thisLink.attr({
'rel': 'external',
'id': 'wikilink-' + index,
'title': 'learn more about ' + $thisLink.text() + ' at Wikipedia'
});

2. each()

3. $()用于创建新的元素

4.To insert new element(s) inside every matched element, use:
.append()
.appendTo()
.prepend()
.prependTo()

5.To insert new element(s) adjacent to every matched element, use:
.after()
.insertAfter()
.before()
.insertBefore()

6.To insert new element(s) around every matched element, use:
.wrap()

7.To replace every matched element with new element(s) or text, use:
.html()
.text()

8.To remove element(s) inside every matched element, use:
.empty()

9.To remove every matched element and descendants from the document without actually deleting them, use:
.remove()
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表