title: Trigger event when an element exists
body: <p>I have an empty <code>div</code> element:</p>
  
  <pre><code>&lt;div class="message"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>At certain point of the webpage, a <code>p</code> tag is dynamically added to the div:</p>
  
  <pre><code>&lt;div class="message"&gt;
    &lt;p&gt;Some Message&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The <code>p</code> can get removed, then added again and so.</p>
  
  <p>What event should I use to listen if the <code>div.message</code> has a <code>p</code> child and execute some code?</p>
  
  <p>I found <a href="https://stackoverflow.com/questions/7219795/jquery-element-exists-event">this</a> question, but it involves external plugins.</p>
  
  <p>Isn't there an easy way to accomplish this?</p>