It should be easy, right? However, I cannot sem find any examples of such functionality anywhere. The problem is that after doing replaceWith (), I want to do something with the elements that were written to the DOM, but if I try to do something with them right after the replaceWith () call, they don't exist yet. I have to be sure that replaceWith () is completely finished. I just want something like this to work:
$('#foo').replaceWith('some text', function() {
Thoughts?
source share