Skip to content

Instantly share code, notes, and snippets.

@SanderSpies
Created October 18, 2013 10:26
Show Gist options
  • Save SanderSpies/7039585 to your computer and use it in GitHub Desktop.
Save SanderSpies/7039585 to your computer and use it in GitHub Desktop.
Simple input event polyfill
// function
function onKeyDown(e){
// [input|textarea] trigger input with target.value // in case of input field, textarea
// [contenteditable] trigger input with textContent // in case of contentEditable ?
}
// detect support for input
if(!'oninput' in document.createElement("input")){
// add polyfill in this case
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment