To add a DOM element using Prototype, you simply embed the HTML content in the Element.insert() function.  In this example, we'll create a DIV element and show code examples for inserting this element into the DOM.

$('body').insert( { top: '<div>here is text in the div</div>'   } );
$('body').insert( {bottom: '<div>here is text in the div</div>' } );
$('body').insert( {before: '<div>here is text in the div</div>' } );
$('body').insert( {after: '<div>here is text in the div</div>'  } );
$('body').insert( '<div>here is text in the div</div>' );