Created
October 18, 2013 10:26
-
-
Save SanderSpies/7039585 to your computer and use it in GitHub Desktop.
Simple input event polyfill
This file contains hidden or 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
// 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