I am trying to observe a change to
<div id="one" class="elem" data-result="inr"></div>
data-result attribute in this div.
Most of the older methods seem to have been depreciated. I realised that MutationObserver is the best way to proceed. and wrote one on my own which did not work. I found the onattrchange.js which is similar.
With this I am trying to solve the problem I face.
I have created this jsfiddle which is able to detect input changes (using $(document).on), but not the changes to data-result attribute.
I have tried two ways... (1) ('body').attrchange
(2) $(document).on('attrchange',...)
I am not sure why this does not work. ( I am also pretty new to js and jquery, learning by coding)
edit: I have found a similar fiddle which does exactly what I want to. I am doing something similar but I guess I have made some small mistake.