Web Development

Converting to Lower Case and Upper Case in JavaScript

To convert a string to lower case in JavaScript we use the following steps:

var sometext=”This is some text.”;
var casechanged=sometext.toLowerCase();

Now the variable casechanged contains “this is some text.”. For upper case in JavaScript:

var sometext=”This is some text.”;
var casechanged=sometext.toUpperCase();

Now the variable casechanged contains “THIS IS SOME TEXT.”.

About the author

Written by Amrit Hallan.

Amrit Hallan is a freelance web developer. You can follow the link below to checkout his website.

If you found this post useful you may also want to check these out:

  1. JavaScript Equivalent of PHP Explode Function
  2. Learning the Basics of JavaScripting
  3. Javascript setTimeout Problem
  4. Finding the Length of a String in JavaScript
  5. Displaying Current Date with JavaScript and Basic Math Calculations
  6. How to Hide your JavaScript with PHP!