Skip to content

Instantly share code, notes, and snippets.

@joelpurra
Last active October 2, 2015 13:58
Show Gist options
  • Save joelpurra/2254354 to your computer and use it in GitHub Desktop.
Save joelpurra/2254354 to your computer and use it in GitHub Desktop.
AutoCleanCallback: Automatic HTML input field cleaning onkeyup/onchange using jQuery
@joelpurra
Copy link
Author

True that it doesn't work with multiple jQuery (sub)objects, but the .length check is just there because it has not been properly tested. QUnit tests are most welcomed (I will create a new github project if so), and also a bit of syntactic sugar/refactoring to allow $("whatever").autoClean...().

It is better to use the debug library than debug = console in a public (internet) environment, but go ahead if you're using it with a known set of browsers.

@joelpurra
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment