jQuery位置 内容 大小 属性 文档的操作

1. 位置
1. offset()

jQuery位置 内容 大小 属性 文档的操作

 


2. position()

jQuery位置 内容 大小 属性 文档的操作

 

jQuery位置 内容 大小 属性 文档的操作

 


2. 大小

jQuery位置 内容 大小 属性 文档的操作

 


1. 内容(content)>内填充(padding)>边框(border)>外边距(margin)
2. height/width
3. innerHeight/innerWidth
4. outerHeight/outerWidth
3. 内容
1. text()
2. html()
3. val()

jQuery位置 内容 大小 属性 文档的操作

 


4. 属性
1. 想要获取返回文本类的属性用attr(标签上写的属性用attr)
2. 想要获取返回布尔值的属性用prop(DOM对象有的属性用prop)

jQuery位置 内容 大小 属性 文档的操作

jQuery位置 内容 大小 属性 文档的操作

 


5. 文档操作
1. 内部添加
1. 往前追加
1. prepend()
2. prependTo()

jQuery位置 内容 大小 属性 文档的操作

 


2. 往后追加
1. append()
2. appendTo()

jQuery位置 内容 大小 属性 文档的操作

 


2. 外部添加
1. 往前加
1. before
2. insertBefore

jQuery位置 内容 大小 属性 文档的操作

 


2. 往后加
1. after
2. insertAfter

jQuery位置 内容 大小 属性 文档的操作

 


3. 替换
1. replaceWith()
2. replaceAll()

jQuery位置 内容 大小 属性 文档的操作

 


4. remove()

jQuery位置 内容 大小 属性 文档的操作

 


5. empty()

jQuery位置 内容 大小 属性 文档的操作

 


6. clone()
1. true:文档和事件都克隆