Prototype This page is part of the Prototype JavaScript framework documentation.
Overview | (...)

Insertion.After takes two parameters, the content to be inserted and the id or pointer to the element after which the content will be inserted.
Insertion.After inserts text (or a HTML snipet) after element.

Syntax


  new Insertion.After(element, content);

element can be any DOM Element object or ID.

content can be either text or HTML snipet.

Example


<p>
   <a href="#" onclick="new Insertion.After('myparagraph', '<p>This is a second paragraph. It\'s not much longer!</p>'); return false;">
      Add a new paragraph
   </a>
</p>

<p id="myparagraph">This is a first paragraph. It isn't very long...</p>

creates:

Add a new paragraph

This is a first paragraph. It isn't very long...