Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
HTML Change/KeyUp events vs Input event
<!-- index.html -->
<input id='abc'/>
<script>
var input = document.getElementById('abc');
input.addEventListener('change', function(event) {
// .. only triggers on input loss of focus
});
input.addEventListener('keyup', function(event) {
// .. triggers on any keyboard interaction
});
</script>
<!-- index.html -->
<input id='abc'/>
<script>
var input = document.getElementById('abc');
input.addEventListener('input', function(event) {
// .. some action logic
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment