Element.update replaces (updates) the content of element with the html string.
V1.5_rc5 (prototype V 1.4.0_rc3)
Element.update(element, html);
<p id="myparagraph">Three witches watch three Swatch
watches. Which witch watch which Swatch watch?</p>
<p>
<a href="#" onclick="Element.update('myparagraph', 'Three \
Swedish switched witches watch three Swiss Swatch watch \
switches. Which Swedish switched witch watch which Swiss Swatch \
watch Switch ?' ); return false;">That's too easy... make it harder!</a>
</p>
creates:
Three witches watch three Swatch watches. Which witch watch which Swatch watch?
That's too easy... make it harder!
<div id="mydiv">
<p>"Our intrepid Doctor set off for the alien castle,
dashing through the flowers. The ground belted past
his heels. The castle inched up the horizon. He desired
a stallion, but no stallion appeared. And that’s how he
discovered that the planet wouldn’t read his mind and
answer his wishes.</p>
<p>As my daughter’s organ instructor explained it, however,
the planet <strong>could read minds</strong> and it
<strong>could grant wishes</strong>. Just not both at
the same time."</p>
</div>
<p>
<a href="#" onclick="Element.update('mydiv', '<p>This is a \
passage from <em>Why\'s (Poignant) Guide to Ruby</em>, \
tenderly (so he says) written and illustrated by <strong>Why \
the Lucky Stiff</strong>.</p>' ); return false;">
What is this? Who wrote it?</a>
</p>
creates:
“Our intrepid Doctor set off for the alien castle, dashing through the flowers. The ground belted past his heels. The castle inched up the horizon. He desired a stallion, but no stallion appeared. And that’s how he discovered that the planet wouldn’t read his mind and answer his wishes.”
“As my daughter’s organ instructor explained it, however, the planet could read minds and it could grant wishes. Just not both at the same time.”