就像标题所说的那样,我需要在div内包装一些div。这是HTML。使用jQuery将div封入到wrapper div
<div class="something1 message">
<span class="message-text">This is notification 1</span>
<input type="text" />
</div>
<div class="something2 message">
<span class="message-text">There can be multiple texts like this</span>
<span class="message-text">There can be multiple texts like this</span>
<span class="message-text">There can be multiple texts like this</span>
<input type="text" />
</div>
<div id="content-wrapper" class"message">
<span class="message-text">Anotherexample</span>
<span class="message-text">There can be multiple texts like this</span>
<input type="text" />
</div>
现在我想什么,输出是:
<div class="something1 message">
<div class="message-text-wrapper">
<span class="message-text">This is notification 1</span>
</div>
<input type="text" />
</div>
<div class="something2 message">
<div class="message-text-wrapper">
<span class="message-text">There can be multiple texts like this</span>
<span class="message-text">There can be multiple texts like this</span>
<span class="message-text">There can be multiple texts like this</span>
</div>
<input type="text" />
</div>
<div id="content-wrapper" class"message">
<div class="message-text-wrapper">
<span class="message-text">Anotherexample</span>
<span class="message-text">There can be multiple texts like this</span>
</div>
<input type="text" />
</div>
基本上所有的“消息文本”跨度是invidual消息div中会我们包裹在里面消息文本wrappe DIV。
希望你明白。
你打算把'单跨度'还是'多跨度',看起来你们都混在一起了。 – Deeptechtons