Unless you are doing something crazy, you should not define changes using JS if you are looking at simple DOM content.
You want to use a combination of server code and JS to handle revision checking to create such a system, but classes like removedand addedprobably should be created on the server side.
source
share