I am trying to add an event listener to detect a change in the state of an HTML5 details node. Initially I tried attaching a listener to the open and close events as it makes logical sense to me for a details node to have those listeners, but it doesn’t and I do not see any mention of them in
Tag: mutation-events
Detect changes in the DOM
I want to execute a function when some div or input are added to the html. Is this possible? For example, a text input is added, then the function should be called. Answer 2015 update, new MutationObserver is supported by modern browsers: Chrome 18+, Firefox 14+, IE 11+, Safari 6+ If you need to support older ones, you may try