Home >>JavaScript String Methods >JavaScript String toLowerCase() Method

JavaScript String toLowerCase() Method

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()

Browser Support

Method Chrome Edge Firefox Safari Opera
toLowerCase() Yes Yes Yes Yes Yes
Here is an example of toLowerCase() method:
<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>
Output:

Click the button to see the Output.

Example 2:
<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>
Output:

Click the button to see the Output.


No Sidebar ads