[jQuery] Add class where input differs
I'm writing an application that will show the history of a form, so
for example record 1 is revision 1 and record 14 is revision 14. This
all works fine and dandy, but what I'm trying to achieve is where the
input value differs to highlight the form field.
I'm imaging the code to basically look like this to just apply the
class
<script>
$(document).ready(function(){
$('.input').addClass("ui-state-highlight");
});
</script>
But how do I identify in the script when to trigger the add class, is
there a differ() function or am I going to have to extend jQuery. I
was looking into a lot of form vaidators where I could see and
simplify based on if field A differed from field B. The concept is
simple enough, just not sure how to envoke it.