title: Use Change function to detect changes in element attribute
body: <p>Hi new to Javascript here so please be gentle. I want to write some js code that detects changes in an element's attribute. tia and any help is appreciated.</p>
  <p>my code reads likes this:</p>
  <pre><code>$(&quot;#targetElement&quot;).attr('testAttr').change(function(){
      //some code to do stuff
  });
  </code></pre>