Skip to content

Instantly share code, notes, and snippets.

@alfredoem
Last active November 19, 2015 15:22
Show Gist options
  • Save alfredoem/364ce1fce4fd6f412657 to your computer and use it in GitHub Desktop.
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.)
$(':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