JavaScript toLowerCase() | Convert a String to Lowercase

The JavaScript toLowerCase() method converts specified string to lowercase. For example:

HTML with JavaScript Code
<!DOCTYPE html>
<html>
<body>

   <p id="xyz"></p>

   <script>
      let myString = "JavaScript is Fun. Is not it?";

      let myLowerString = myString.toLowerCase();
      document.getElementById("xyz").innerHTML = myLowerString;
   </script>
   
</body>
</html>
Output

That is, all the uppercase characters of specified string will be converted into its lowercase equivalent.

JavaScript toLowerCase() Syntax

The syntax of toLowerCase() method in JavaScript is:

string.toLowerCase()

The toLowerCase() method does not change the original string. Rather it returns a new string which is the exact copy of the original string, except that, all characters will be in lowercase.

JavaScript Online Test


« Previous Tutorial Next Tutorial »



Like/Share Us on Facebook 😋