Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/78.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/rust/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
Javascript wrapAll不包装纯文本_Javascript_Jquery - Fatal编程技术网

Javascript wrapAll不包装纯文本

Javascript wrapAll不包装纯文本,javascript,jquery,Javascript,Jquery,有些HTML如下所示: <body> Do all declarations for the same <TT>static</TT> function or variable have to include the storage class <TT>static</TT>? </body> 如何修复此问题,使其保留原始结构?子节点不返回文本节点。您需要使用

有些HTML如下所示:

  <body>
    Do
    all
    declarations for
    the same
    <TT>static</TT> function
    or variable
    have to include the storage class <TT>static</TT>?
  </body>

如何修复此问题,使其保留原始结构?

子节点
不返回文本节点。您需要使用
目录

$('body').contents().wrapAll("<div class='container'><div class='row'><div class='col-md-12'></div></div></div>");
$('body').contents().wrapAll(“”);
$(函数(){
$('#children').children().wrapAll(“”);
$('#contents').contents().wrapAll(“”);
});

关于儿童:
做
全部的
声明
相同的
静态函数
或变量
必须包含存储类static吗?
内容包括:
做
全部的
声明
相同的
静态函数
或变量
必须包含存储类static吗?

尝试
.contents()
而不是
.children()
.wrapInner()
在这里也适用于您:
$('body').contents().wrapAll("<div class='container'><div class='row'><div class='col-md-12'></div></div></div>");