jQuery在注释标记后插入元素
我正在尝试在注释标记jQuery在注释标记后插入元素,jquery,Jquery,我正在尝试在注释标记后插入,但我不确定如何实现这一点?到目前为止,我的代码是: html: 一些内容 更多内容 更多内容 jQuery: $( ".tab-content" ) .contents() .filter(function() { return this.nodeType === 8;} .each().after( "<br/><br/>" ).end()); $(“.tab内容”) .contents() .filter(函数(){
后插入
,但我不确定如何实现这一点?到目前为止,我的代码是:
html:
一些内容
更多内容
更多内容
jQuery:
$( ".tab-content" )
.contents()
.filter(function() {
return this.nodeType === 8;}
.each().after( "<br/><br/>" ).end());
$(“.tab内容”)
.contents()
.filter(函数(){
返回this.nodeType===8;}
.each()。在(“
”).end()之后;
有人能就如何实现这一目标提出建议吗
谢谢你很接近。您不需要每个
$(“.tab内容”).contents().filter(函数(){
返回this.nodeType==8;
}).在(“
”)之后
一些内容
更多内容
更多内容
你很接近。您不需要每个
$(“.tab内容”).contents().filter(函数(){
返回this.nodeType==8;
}).在(“
”)之后
一些内容
更多内容
更多内容
看看这个。看看这个。
$( ".tab-content" )
.contents()
.filter(function() {
return this.nodeType === 8;}
.each().after( "<br/><br/>" ).end());