String toLocaleUpperCase() Method - Javascript String

Javascript examples for String:toLocaleUpperCase

Description

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

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

Parameters

None.

Return Value:

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

The following code shows how to Convert the string to uppercase 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 www  . j  ava  2s .c o m*/
    var str = "Hello World!";
    var res = str.toLocaleUpperCase();
    document.getElementById("demo").innerHTML = res;
}
</script>

</body>
</html>

Related Tutorials