title: JavaScript: Listen for attribute change?
body: <p>Is it possible in JavaScript to listen for a change of attribute value? For example:</p>
  
  <pre><code>var element=document.querySelector('…');
  element.addEventListener( ? ,doit,false);
  
  element.setAttribute('something','whatever');
  
  function doit() {
  
  }
  </code></pre>
  
  <p>I would like to respond to any change in the <code>something</code> attribute.</p>
  
  <p>I have read up on the <code>MutationObserver</code> object, as well as alternatives to that (including the one which uses animation events). As far as I can tell, they are about changes to the actual DOM. I’m more interested in attribute changes to a particular DOM element, so I don’t think that’s it. Certainly in my experimenting it doesn’t seem to work.</p>
  
  <p>I would like to do this <em>without</em> jQuery.</p>
  
  <p>Thanks</p>