JavaScript toLowerCase() method


JavaScript toLowerCase() Method


Definition and usage


toLowerCase() method is used to convert strings Convert to lowercase.

Syntax

string.toLowerCase()


Browser support

QQ截图20161108165429.png

All major browsers support the toLowerCase() method


Example

Example

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>

<script>
var txt="Hello World!";
document.write(txt.toLowerCase() + "<br>");
document.write(txt.toUpperCase());
</script>

</body>
</html>

Run Instance»

Click the "Run Instance" button to view the online instance