String toLowerCase() Method - Javascript String

Javascript examples for String:toLowerCase

Description

The toLowerCase() method converts a string to lowercase letters.

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

Parameters

None.

Return Value:

A String, representing the value of a string converted to lowercase

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  w ww .ja v a2s.  c o m
    var str = "Hello World!";
    var res = str.toLowerCase();
    document.getElementById("demo").innerHTML = res;
}
</script>

</body>
</html>

Related Tutorials