I need to call a JS function when classname of the HTML file is changed via Javascript/JQuery.
<html xmlns = "http://www.w3.org/1999/xhtml" class = "A">
-
-
-
-
-
</html>
Now the class name A is getting changed on runtime depending on some conditions and whenever this class name is changing, I need to call another JS function.
I am getting the classname from document.documentElement.className/document.documentElement.classList and was trying to add EventListener to achieve this, but could not succeed.
Could you please advise.
Thanks and Regards, Aniket