我有一个带有数据的变量wrapper
:
<div class="elementwrapper" draggable="true" ondragstart="drag(event)" >
<span class="edittool">
<span class="glyphicon glyphicon-pencil editpencil" onclick="editContent(this);" style="padding:0 5px 0 0;"></span>
<span class="glyphicon glyphicon-ok editok" onclick="doneEdit(this);" style="display:none;padding:0 5px 0 0;"></span>
<span class="glyphicon glyphicon-remove editcancel" onclick="doneEdit(this);" style="display:none;padding:0 5px 0 0;"></span>
</span>
</div>
我想将当前元素数据包含在span
类edittool
中。我用过:
$(currentElement).wrap(wrapper);
但我得到的是:
<div class="elementwrapper" draggable="true" ondragstart="drag(event)" >
<span class="edittool">
<span class="glyphicon glyphicon-pencil editpencil" onclick="editContent(this);" style="padding:0 5px 0 0;">
MY DATA
</span>
<span class="glyphicon glyphicon-ok editok" onclick="doneEdit(this);" style="display:none;padding:0 5px 0 0;"></span>
<span class="glyphicon glyphicon-remove editcancel" onclick="doneEdit(this);" style="display:none;padding:0 5px 0 0;"></span>
</span>
</div>
它应该在edittool
span
内,并且应该在其内部spans
之后。我该怎么办?