5.4.20 The Insertion.After 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. How’s it going?</span>
<script>
new Insertion.After('person', ' Are you there?');
</script> 

将把HTML 变为

<br>Hello, <span id="person">Wiggum. Hows it going?
</span> Are you there?