-
Notifications
You must be signed in to change notification settings - Fork 20.5k
Closed
Labels
Description
Bug Reports:
With [prevAll] and then with [wrapAll], the order of the nodes in the dom changes
Description
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>
</head>
<body>
<div id="row" style="border: 1px solid black;">
<span>【one】</span>
<span>【two】</span>
<span id="middle">【middle】</span>
<span>【three】</span>
<span>【four】</span>
</div>
<div id="jqueryChange" style="border: 1px solid black;margin-top: 50px;">
<span>【one】</span>
<span>【two】</span>
<span id="middle">【middle】</span>
<span>【three】</span>
<span>【four】</span>
</div>
</body>
<script>
$(function() {
$("#jqueryChange #middle").each(function () {
$(this).prevAll()
.wrapAll("<p/>")
.end()
.nextAll()
.wrapAll("<p/>")
})
})
</script>
</html>