Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery在注释标记后插入元素_Jquery - Fatal编程技术网

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());