Introduction - no jQuery allowed!
I am in search of a way to track changes made to a specific DOM element that I can access using:
var el = document.getElementById('the-element');
Whenever a CSS class is added or removed from the el
, I need the name of the CSS class to be sent to a function.
I am open to alternative solutions that are practical and effective.
For instance:
el.onClassChange(updateFunction);
function updateFunction(classname, status) {
console.log('The classname is '+classname+' - '+status);
}