title: How to run a function once after element has been found with Jquery/Javascript
body: <p>Is there a way I can run a function once after a specific element has been found?</p>
  
  <p>I tried this:</p>
  
  <pre><code>setInterval(function () {
       if ($('.imagewrapper').length) {
              self.carousel();
       }    
  }, 1000)
  </code></pre>
  
  <p>So, it checks my page continiously if the <code>.imagewrapper</code> element exisit, and if so, it should run the <code>self.carousel()</code>function. The problem is, that this way, as soon the element exists, it runs the function continiously. Is there a way around?</p>
  
  <p>ps: The <code>setInterval</code>-method needs to be there.</p>