Skip to content

Instantly share code, notes, and snippets.

@rlemon
Created August 27, 2015 18:27
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 rlemon/b74d9555405c3772dede to your computer and use it in GitHub Desktop.
Save rlemon/b74d9555405c3772dede to your computer and use it in GitHub Desktop.
input fuker
[...document.querySelectorAll('input[type="text"],textarea')].forEach(el=>{
let fn = () => {
el.addEventListener('keyup', () => {
( Math.random()<.9 ) && ( return );
this.selectionEnd = this.selectionStart = Math.random()*this.value.length|0;
};
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment