使用jQuery包装html的某些部分

The*_*art 5 javascript jquery

我有类似的东西:

<div class="the_notice">
    <span class="time"> | 3:48pm</span>
    To <strong>2013-03-16_10-56-33</strong> By <strong>XYX</strong>
</div>
Run Code Online (Sandbox Code Playgroud)

结果我想要的东西:

<div class="the_notice">
    <span class="time"> | 3:48pm</span>
    <div class="wrap">
      To <strong>2013-03-16_10-56-33</strong> By <strong>XYX</strong>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

我怎样才能使用jQuery实现这一目标?请帮助我.

epa*_*llo 5

好吧,如果内容总是相同,你可以做类似的事情

$('.the_notice').contents().slice(2).wrapAll('<div class="wrap"/>');
Run Code Online (Sandbox Code Playgroud)

http://jsfiddle.net/Ysq48/