JavaScript

How to Convert a String to Lowercase in Javascript

To convert an uppercase letter to a lowercase letter, we use the toLowerCase() method in javascript. This method does not affect numbers, special characters, and alphabets that are already lowercase.
 

Program to Convert a String to Lowercase in Javascript
<!doctype html>
<html>
   <head>
      <script>
         function min() {
           var str = "WELCOME TO STACKHOWTO!";
           var res = str.toLowerCase();
           document.getElementById("text").innerHTML = res;
         }
      </script>
   </head>
   <body>
      <button onclick="min()">Click here to convert the string</button>
      <p id="text"></p>
   </body>
</html>
Result

WELCOME TO STACKHOWTO!

mcqMCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More

Leave a Reply

Your email address will not be published. Required fields are marked *