Last active
August 29, 2015 14:14
-
-
Save xxami/d55c807106614234704b to your computer and use it in GitHub Desktop.
javascript update on text field change
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 type="text" onchange="var that=this;setTimeout(function(){do_this(that.value);},50);" onkeypress="this.onchange();" onpaste="this.onchange();" oncut="this.onchange();" oninput="this.onchange();"> | |
<script type="text/javascript"> | |
function do_this(value) { | |
console.log(value); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment