The jQuery Capitalize Plugin provides capitalization for your inputs fields (or any other element) for proper names, places etc.
How to get the plugin:
npm install jquery-capitalize
bower install jquery-capitalize
Download the latest release
- Fork or clone this repo
- Run
npm install
to install the build tools - Run
gulp
- The generated file will be at the dist folder
Include jQuery and the plugin on a page. Apply the plugin on the elements you want.
<input type="text" id="name" />
<script src="jquery.js"></script>
<script src="jquery.capitalize.min.js"></script>
<script>
$(document).ready(function(){
$('#name').capitalize();
});
</script>
Before | After |
---|---|
JOÃO A.DA SILVA | João A. da Silva |
ruA DA praça xv | Rua da Praça XV |
jonnas fonini | Jonnas Fonini |
LOUIS VAN GAAL | Louis van Gaal |
áREa de teRra | Área de Terra |
Thanks to Fausto Gonçalves Cintra for the original PHP code.
Copyright (c) 2017 Jonnas Fonini. Licensed under the MIT license.