2 Example(s) of JavaScript toLocaleLowerCase function


Description :

JavaScript toLocaleLowerCase() function is used to convert string to lowercase string. See the code snippet:


JavaScript toLocaleLowerCase function Example - 1
<!DOCTYPE html>
<html>
<head>
<title>Welcome to LearnKode - A code learning platform</title>
</head>
<body>
<button onclick="convertToLowercase()">Show the lowercase letters</button>
<p id="sample"></p>
<script>
function convertToLowercase() {
    var str = "I LOVE LEARNKODE";
    var result = str.toLocaleLowerCase();
    document.getElementById("sample").innerHTML = result;
}
</script>

</body>
</html>

Output

Description :

JavaScript toLocaleLowerCase() will convert strings to lower case


JavaScript toLocaleLowerCase function Example - 2
<!DOCTYPE html>
<html>
<head>
<title>Welcome to LearnKode - A code learning platform</title>
</head>
<body>

<script>
 var Str1 = "Learn JavaScript at LearnKode";
  var Str3 = Str1.toLocaleLowerCase();
 var Str4 = "Hi, This is FROM JS".toLocaleLowerCase();
 var Str5 = "JAVASCRIPT LOWERCASE".toLocaleLowerCase();
 
 document.write("<b> Lowercase Letters are:</b> " + Str3);
 document.write("<br \> <b> Lowercase Letters are: </b> " + Str4);
 document.write("<br \> <b> Lowercase Letters are: </b> " + Str5);
</script>

</body>
</html>

Output