Last active
November 19, 2015 15:22
-
-
Save alfredoem/364ce1fce4fd6f412657 to your computer and use it in GitHub Desktop.
Detecta cada vez que se introduce texto en un input, sea cual sea el medio (copy and paste, drag and drop, etc.)
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
$(':input').on('propertychange input', function (e) { | |
var valueChanged = false; | |
if (e.type=='propertychange') { | |
valueChanged = e.originalEvent.propertyName=='value'; | |
} else { | |
valueChanged = true; | |
} | |
if (valueChanged) { | |
/* Code goes here */ | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment