In the bad old days of desktop applications, every form object in the world had a Dirty property that let you easily check to see if the user had made any changes to the data on the form. It’s almost as easy with client-side code running in the Web browser, provided you use jQuery. This line finds every input tag and ties the tag’s change event to a JavaScript function called flagChanges:
$("input").change(function ()
{
flagChanges();
});
Read more in Visual Studio Magazine;
Other References
https://www.c-sharpcorner.com/blogs/page-is-dirty-using-javascript1

