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

Asked

Viewed 126 times

2

With every change in GIFT (Document Object Model), whether it is an inclusion, exclusion or even a modification in some element I would like to perform a function, there is some "simple" way to do this?

If such specific changes cannot be detected, a method that would detect any change is sufficient.

1 answer

3


Currently, the most recommended solution is the use of 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 change in certain parts of the DOM.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.