Last active
December 12, 2015 04:39
-
-
Save BernardoSilva/4716266 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.myElements').each(function() { | |
var elem = $(this); | |
// Save current value of element | |
elem.data('oldVal', elem.val()); | |
// Look for changes in the value | |
elem.bind("propertychange keyup input paste", function(event){ | |
// If value has changed... | |
if (elem.data('oldVal') != elem.val()) { | |
// Updated stored value | |
elem.data('oldVal', elem.val()); | |
// Do action | |
.... | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment