JavaScript:
$(document).ready(function () {
$.each($(".item"), function(index, value) {
thisEl = $(this);
thisEl.children("strong").after("<span style='display:inline-block'>");
$("</span>").appendTo(thisEl);
});
});
HTML:
<div class="item">
<strong>Time Cond:</strong>
MorningCheck
</div>
应该:
<div class="item">
<strong>Time Cond:</strong>
<span> MorningCheck</span>
</div>
但是</span>
在文本之前被注入MorningCheck
我做错了什么?