Home >>JavaScript String Methods >JavaScript String toLowerCase() Method
JavaScript toLowerCase() method is used to converts a given input string to all lowercase letters. It does not change the original given input string.
Syntax:string.toLowerCase()
Method | Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
toLowerCase() | Yes | Yes | Yes | Yes | Yes |
<html> <body> <p>Click the button to see the Output.</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { var str = "PHPTPOINT"; var res = str.toLowerCase(); document.getElementById("demo").innerHTML = res; } </script> </body> </html>
Click the button to see the Output.
<html> <body> <p>Click the button to see the Output.</p> <button onclick="myFunction1()">Try it</button> <p id="demo1"></p> <script> function myFunction1() { var str = "ABHIMANYU"; var res = str.toLowerCase(); document.getElementById("demo1").innerHTML = res; } </script> </body> </html>
Click the button to see the Output.