Let me explain the issue I'm encountering:
I begin with
<container>
<div id="foo"></div>
</container>
After that, I populate content into the container div
using Ajax
<container>
<div id="bar"></div>
</container>
and then reload the original content back in
<container>
<div id="foo"></div>
</container>
However, at this point, I encounter an issue where targeting #foo
with javascript becomes problematic as JavaScript interprets it as a new element.
The code is much more complex than this simplified version, and I need to refresh the entire DOM after the ajax load in order to access multiple elements that were present before the load.