String toLocaleLowerCase() Method - Javascript String

Javascript examples for String:toLocaleLowerCase

Description

The toLocaleLowerCase() method converts a string to lowercase letters, according to the host's current locale.

The toLocaleLowerCase() method does not change the original string.

Parameters

None.

Return Value:

A String, representing the value of a string converted to lowercase according to the host's current locale

The following code shows how to Convert the string to lowercase letters:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {//from ww w  . ja v a  2  s  .  co  m
    var str = "Hello World!";
    var res = str.toLocaleLowerCase();
    document.getElementById("demo").innerHTML = res;
}
</script>

</body>
</html>

Related Tutorials