Javascript examples for String:toUpperCase
The toUpperCase() method converts a string to uppercase letters.
The toUpperCase() method does not change the original string.
None.
A String, representing the value of a string converted to uppercase
The following code shows how to Convert the string to uppercase letters:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*w w w. j ava 2 s . c o m*/ var str = "Hello World!"; var res = str.toUpperCase(); document.getElementById("demo").innerHTML = res; } </script> </body> </html>