Created
October 22, 2018 21:22
-
-
Save snowbob/dd2bf278e8788932193fda44c749ebc8 to your computer and use it in GitHub Desktop.
get previous value
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
$(document).on('focusin', 'input', function(){ | |
console.log("Saving value " + $(this).val()); | |
$(this).data('val', $(this).val()); | |
}).on('change','input', function(){ | |
var prev = $(this).data('val'); | |
var current = $(this).val(); | |
console.log("Prev value " + prev); | |
console.log("New value " + current); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment