Preamble - absolutely no jQuery!
I need to monitor a particular DOM element that I have access to via:
var element = document.getElementById('the-element');
When a CSS class is added or removed from element
, I need the CSS class name to be delivered to a function.
I am happy to accept reasonable workarounds.
For example:
element.onClassChange(myFunction);
function myFunction(classname, state) {
console.log('The classname is '+classname+' - '+state);
}