JavaScript String toLowerCase() method : The toLowerCase() method is used to convert the letters to the lower case. It doesn't change the original string. It returns the new string in lower case.
Syntax of toLowerCase() method :
string.toLowerCase()
Example of toLowerCase() method :
<!DOCTYPE html>
<html>
<body>
<p>To string to lowercase letters, click on button.</p>
<button onclick="convertLowerCase()">convert</button>
<p id="container"></p>
<script>
function convertLowerCase() {
var str = "It is my turn!";
var result = str.toLowerCase();
document.getElementById("container").innerHTML = result;
}
</script>
</body>
</html>
Output : it is my turn!
0 Comment(s)