Skip to content

Instantly share code, notes, and snippets.

@fizx
Created April 2, 2009 17:21
Show Gist options
  • Save fizx/89300 to your computer and use it in GitHub Desktop.
Save fizx/89300 to your computer and use it in GitHub Desktop.
jQuery("textarea[maxlength]").change(function(){
var len = parseInt(jQuery(this).attr("maxlength"));
var text = jQuery(this).val().substr(0, len);
jQuery(this).val(text);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment