5.4.17 The Insertion.Before class

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

继承自Abstract.Insertion

在给定元素开始标记的前面插入HTML。

MethodKindArgumentsDescription
[ctor](element, content)constructorelement: element object or id, content: HTML to be inserted继承自 Abstract.Insertion. 创建一个可以帮助插入动态内容的对象。

下面的代码

<br>Hello, <span id="person"> Wiggum. Hows’it going? </span> <script> new Insertion.Before('person', 'Chief '); </script> 将HTML变成: <br>Hello, Chief <span id="person">Wiggum. How’s it going?</span> The Insertion.Top class