继承自Abstract.Insertion
在给定元素开始标记的前面插入HTML。
Method | Kind | Arguments | Description |
[ctor](element, content) | constructor | element: 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