87,923
社区成员
发帖
与我相关
我的任务
分享
$(function(){
$("body>div").wrap("<div class='test'></div>");
});
<body>
<div id="wrap">
其他内容
</div>
<script>
alert($);
</script>
</body>
<body>
<div class='test'>
<div id="wrap">
其他内容
</div>
<script>
alert($);
</script>
</div>
</body>
$(function(){
$('<\script>alert("zswang 路过")<\/script>').appendTo('body');
});
<head>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.2.min.js"></script>
<script>
$(function(){$("body").wrapInner("<div class='test'></div>");});
</script>
</head>
<body>
<div id="wrap">
其他内容
</div>
<script>
alert($);
</script>
</body>
<head>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.2.min.js"></script>
<script>
$(function(){
$("body").wrapInner("<div class='test'></div>");
});
</script>
</head>
<body>
<div id="wrap">其他内容</div>
</body>
$("script").remove();