<p>
<span class="s1">s1</span>
</p>
<script>
$("p").append('<span class="s2">s2</span>');
</script>
结果是在 <p>和</p>之间,</span>之后追加’
<p>
<span class="s1">s1</span>
</p>
<script>
$("p").after('<span class="s2">s2</span>');
</script>
结果是在 </p>之后追加’
append/prepend和after/before有什么区别?
最新推荐文章于 2024-11-04 16:17:23 发布