Capitalize input

function capitalize(){ $.each($("input"), function(){ $(this).on("keyup", function(){ if($(this).hasClass("text-cap")){ $('input[type=text]').val (function () { return this.value.toUpperCase(); }); } }); }); }
This function capitalize input values on keyup.
For the field which you want to activate function, specify class name 'text-cap' and you are done

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.