JavaScript tutorial:
toLowerCase method

 

Applies to: String Object

The toLowerCase method returns a string where all alphabetic characters have been converted to lowercase.

Syntax

strVariable.toLowerCase( )
"String Literal".toLowerCase( )

Return value

The toLowerCse() method convert specific string to lowercase and returns a converted string.

Example

The toLowerCase method has no effect on nonalphabetic characters.

The following example demonstrates the effects of the toLowerCase method:
function convertToLowerCase(string)
{
return string.toLowerCase( );
}
document.write(convertToLowerCase("I WANT TO CONVERT THIS TEXT TO LOWERCASE"));

To run the code, paste it into JavaScript Editor, and click the Execute button.