In the following example code, I attach an onclick event handler to the span containing the text \"foo\". The handler is an anonymous function that pops up an <
onclick
Now, it is 2012, and jQuery has append and prepend functions that do exactly this, add content without effecting current content. Very useful.