Skip to content

Instantly share code, notes, and snippets.

@stenvdb
Created March 19, 2012 11:15
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stenvdb/2107947 to your computer and use it in GitHub Desktop.
Save stenvdb/2107947 to your computer and use it in GitHub Desktop.
jQuery: Capitalize first letter of string
$.fn.capitalize = function () {
$.each(this, function () {
var caps = this.value;
caps = caps.charAt(0).toUpperCase() + caps.slice(1);
this.value = caps;
});
return this;
};
@mantessa
Copy link

ddd

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