我有以下HTML喜欢
<body>
<div class="myCool">blah</div>
<div class="cool">some text</div>
<div class="cool">some text</div>
<div class="cool">some text</div>
<div class="cool">some text</div>
<div class="myCool">blah</div>
<div class="cool">some text</div>
<div class="cool">some text</div>
<div class="cool">some text</div>
<div class="cool">some text</div>
</body>
我想做的是从myCool
开始,把它和接下来的4个类cool
Package 成一个div
?所以看起来
<div id="1" class="myWrapped">
<div class="myCool">blah</div>
<div class="cool">some text</div>
<div class="cool">some text</div>
<div class="cool">some text</div>
<div class="cool">some text</div>
</div>
<div id="2" class="myWrapped">
<div class="myCool">blah</div>
<div class="cool">some text</div>
<div class="cool">some text</div>
<div class="cool">some text</div>
<div class="cool">some text</div>
</div>
你知道我该怎么做吗
2条答案
按热度按时间flmtquvp1#
尝试
gojuced72#
你可以这样做