Skip to content

Instantly share code, notes, and snippets.

@xxami
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xxami/d55c807106614234704b to your computer and use it in GitHub Desktop.
Save xxami/d55c807106614234704b to your computer and use it in GitHub Desktop.
javascript update on text field change
<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