JavaScript – Check if Form is Dirty

A common usecase. You need to check if user changed anything in an HTML form. Below function formIsDirtyreturns a boolean value true or false depending on weather user modified something within the form.

Wrap it all up: