/

HTML / CSS / JavaScript Tutorial

JavaScript String method: toLocaleLowerCase()

[this page | pdf | back links]

The toLocaleLowerCase() method (when applied to a JavaScript string) returns a string that is the original string converted to lower case characters, bearing in mind the language settings of the browser (so sometimes does not return the same as toLowerCase).

 

It has the following syntax (with no parameters):

 

string.toLocaleLowerCase()

 

EXAMPLE:


HTML USED IN THIS EXAMPLE:
<!DOCTYPE html>
<html> <!-- Copyright (c) Nematrian Limited 2018 -->
<head>
<style>
table,th,tr,td {border: 1px solid black; border-collapse: collapse;}
</style>
</head>
<body>
<table>
<tr>
<th>Example</th>
<th>Resulting value of <code>x</code></th>
</tr>
<tr>
<td><code id="Example"></code></td>
<td><code id="Result"></code></td>
</tr>
</table>

<script>
var q = "aBcD";
document.getElementById("Example").innerHTML =
  'var q = "' + q + '";<br>' +
  'var x = q.toLocaleLowerCase();';
document.getElementById("Result").innerHTML =
  q.toLocaleLowerCase();
</script>

</body>
</html>

FUNCTION THAT MAY ASSIST IN TESTING WHETHER FEATURE IS SUPPORTED:
function isSupportedJavaScriptMethodStringToLocaleLowerCase() {
  var z = "abc"; return !!z.toLocaleLowerCase;
}


NAVIGATION LINKS
Contents | Prev | Next | JavaScript String Variables


Desktop view | Switch to Mobile