title: How should jQuery execute on .html() elements?
body: <p>What is the appropriate way to use jquery statements on HTML elements you added during a function call?</p>
  
  <pre><code>Reset: function() {
  $("#viewarea").empty();
  
  Loader: function() {
  Reset();
  
  $("#viewarea").html(//HTML CODE);
  $(function() {
      $("#viewarea").each(function(index){
          console.log(this);
      });
  });
  </code></pre>
  
  <p>My code has this Loader function that will clear a div element and add content to the page. When I want to switch to a new page I clear the entire viewarea and write new content so I do not have to reload the page. My problem is that I have elements being drawn to the page and the jQuery selector will not FIND these elements. Right now jquery statements execute on document ready but even without that it will not find the elements.</p>
  
  <p>I think the solution should be some type of method that will make the jquery statement wait on $().html() to be done before trying to find elements on the page.</p>