Jquery中Append与html与innerHtml的区别
时间:2011-11-30
来源:互联网
刚学Jquery啊,请各位高手指教。 Jquery中,Append,html,innerHtml三者的用法和区别
作者: champ0810 发布时间: 2011-11-30
.append( content )
content一个元素,HTML字符串,或者jQuery对象,用来插在每个匹配元素里面的末尾。
version added: 1.4.append( function(index, html) )
function(index, html)一个返回HTML字符串的函数,该字符串用来插入到匹配元素的末尾。 Receives the index position of the element in the set and the old HTML value of the element as arguments.
.html() 返回: String
从匹配的第一个元素中获取HTML内容。
version added: 1.0.html()
.innerHTML 是js的原生方法,指容器内部的html例如
<div>内容内容<span>内容</span></div>
content一个元素,HTML字符串,或者jQuery对象,用来插在每个匹配元素里面的末尾。
version added: 1.4.append( function(index, html) )
function(index, html)一个返回HTML字符串的函数,该字符串用来插入到匹配元素的末尾。 Receives the index position of the element in the set and the old HTML value of the element as arguments.
.html() 返回: String
从匹配的第一个元素中获取HTML内容。
version added: 1.0.html()
.innerHTML 是js的原生方法,指容器内部的html例如
<div>内容内容<span>内容</span></div>
作者: p2227 发布时间: 2011-11-30
append()方法插入指定在结束(但还在里面)选定的元素的内容。
html更改所选元素的(内部)的HTML
html更改所选元素的(内部)的HTML
作者: zsx841021 发布时间: 2011-11-30
append()是添加子节点
html()和innerhtml作用一样 在容器中添加要添加的代码
有时只能用append 比如table 不能用html和innerhtml
html()和innerhtml作用一样 在容器中添加要添加的代码
有时只能用append 比如table 不能用html和innerhtml
作者: qq307023807 发布时间: 2011-11-30
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28