How to detect changes in the Document Object Model (DOM)

2

Every change in the DOM (Document Object Model), whether it is an inclusion, deletion or even a modification to some element I would like to perform a function, is there any "simple" way of doing This?

If there is no way to detect such specific changes, a method that detects any changes made is enough.

    
asked by anonymous 10.03.2017 / 13:01

1 answer

3

Currently the most recommended solution is to use a Mutation Observer

Full support chart by browsers can be checked at here

What is a Mutation Observer?

It is an API that allows a function to be called asynchronously when there is a change in certain parts of the DOM.

    
10.03.2017 / 13:21