> Why does replaceAll only seem to work once in this example?

I guess you meant replaceWith?

>       $("#hello").replaceWith("foo");

Once this code executes, it has replaced the element with
id="hello" (and any children) with the string "foo". There is no
longer a #hello in the document.

http://docs.jquery.com/Manipulation/replaceWith#content

If you just want to replace the stuff inside #hello, try $
("#hello").empty().append("foo") or $("hello").html("foo").

Reply via email to