How can I check if a post is dirty using javascript on the edit post screen?

How can I check if a post is dirty using javascript on the edit post screen?