javascript compare two DOM trees

Posted by Paul on Stack Overflow See other posts from Stack Overflow or by Paul
Published on 2010-05-25T06:01:04Z Indexed on 2010/05/25 6:21 UTC
Read the original article Hit count: 402

Filed under:
|

I want to compare the change of a DOM node after a user event is fired on it; but I don't know on which element a user would fire, so my idea is to (1) save the DOM tree before an event and (2) compare the saved tree with the updated DOM tree when an event is fired.

My question are (1) is there any better way? and (2) if there is no other way, what would be the fast algorithm to compare two DOM trees?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about dom