Top :: Insertion

new Insertion.Top(element, html) Inserts the html into the page as the first child of element.

Example

Original HTML

<div id="modern_major_general">

<p>In short, in all things vegetable, animal, and mineral...</p>

</div>

JavaScript

new Insertion.Top('modern_major_general', "<p>I am the very model of a modern major general.</p>");

Resulting HTML

<div id="modern_major_general">

<p>I am the very model of a modern major general.</p>

<p>In short, in all things vegetable, animal, and mineral...</p>

</div>

Prototype API 1.5.0 - prototypejs.org