Converting Lower case text to Uppercase in JavaScript


We can convert lowercase letter to upper case letter by using toUpperCase() method in JavaScript. This you must have seen in some sites were after entering your user id and when we come out of input box, it changes to uppercase. Here this function toUpperCase() is used along with a event handler. Here is the basic syntax for toUpperCase method.


var a1 = str.toUpperCase();


Here str is our string variable. The new string ( with uppercase letters ) is stored in new variable a1.

Here is the sample code

var str="This is my 1st new tutorial 123";
var a1 = str.toUpperCase();
document.write(a1);



Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com




    Prakash

    11-03-2010

    Well Useful

    Post your comments , suggestion , error , requirements etc here .




    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2021 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer