.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Code Snippets >> Javascript >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Making first letter as capital through java script

Posted By:Gowthammanju       Posted Date: July 30, 2011    Points: 40    Category: Javascript    URL: http://www.dotnetspark.com  

This code explains about making of first letter capital while user enteres the values in text box

Here it is as

function InitCap(str)
        var str = this.toLowerCase();
        var Rx = /\b([a-z']+)\b/gi;
        str = str.replace(Rx, function (w)
            return w.charAt(0).toUpperCase() + w.substring(1);
        return str;
call this function inside the text box which you want......


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend