5.4.19 The Insertion.Bottom class

优质
小牛编辑
131浏览
2023-12-01

继承自Abstract.Insertion

在给定元素最后一个子节点位置插入HTML。内容将位于元素的结束标记的紧前面。

MethodKindArgumentsDescription
[ctor](element, content)constructorelement: element object or id, content: HTML to be insertedInherited from Abstract.Insertion. Creates an object that will help with dynamic content insertion.

下面的代码

<br>Hello,
<span id="person">
Wiggum. Hows it going?
</span>
<script>
new Insertion.Bottom('person', " What's up?");
</script> 

将把HTML 变为:

<br>Hello, <span id="person">Wiggum. How’s it going? What’s up?</span>