|
|
Converting Lower case text to Uppercase in JavaScriptWe 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);
Converting Uppercase letter to lower case using toLowerCase() method
Found anything wrong or wants to improve the code by adding more features? Post your short comment here or use the Forum
| |
| | Prakash | 11-03-2010 |
|---|
| Well Useful |
|
|
|
|
|
|