Computer >> Computer tutorials >  >> Programming >> Javascript

How to convert a string into the lower case using JavaScript?


To convert a string into lower case, use the JavaScript toLowerCase() method. This method returns the calling string value converted to lowercase.

Example

You can try to run the following code to convert a string into the lower case −

<html>
   <head>
      <title>JavaScript String toLowerCase() Method</title>
   </head>

   <body>
      <script>
         var str = "DEMO TEXT";
         document.write(str.toLowerCase( ));
      </script>
   </body>
</html>