title: How can you detect when a div has a class added/taken from it?
body: <p>I am trying to make a script which plays a sound when a div's class name is modified.</p>
  
  <p>Take the following example:</p>
  
  <pre><code>&lt;div class="move"&gt;1&lt;/div&gt;
  &lt;div class="move"&gt;2&lt;/div&gt;
  &lt;div class="move"&gt;3&lt;/div&gt;
  &lt;div class="move active"&gt;4&lt;/div&gt;
  &lt;div class="move"&gt;5&lt;/div&gt;
  </code></pre>
  
  <p>It's a browser game, and whenever a new move is made, the "active" class name is moved to a different div tag, and removed from the current one. How can I detect this change with an event instead of constantly checking the status of the active div?</p>
  
  <p>EDIT: I see you've marked my question as a possible duplicate. That does not answer my question, because I am trying to add functionality to an existing website, I cannot add my own event to the divs because the website itself is creating them. </p>