title: Event trigger on a class change
body: <p>I'd like my event to be <strong>triggered</strong> when a div tag containing a <strong>trigger</strong> class is changed.</p>
  
  <blockquote>
    <p>I have no idea how to make it listen to the class' adding event.</p>
  </blockquote>
  
  <pre><code>&lt;div id="test"&gt;test&lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
      document.getElementById.setAttribute("class", "trigger");
  
      function workOnClassAdd() {
         alert("I'm triggered");
      }
  &lt;/script&gt;
  </code></pre>