revision:
The toUpperCase() method converts a string to uppercase letters. The toUpperCase() method does not change the original string.
string.toUpperCase()
Parameters: none
<p>toUpperCase() converts a string to lowercase letters:</p> <p id="demo"></p> <script> let text = "Hello World!"; let result = text.toUpperCase(); document.getElementById("demo").innerHTML = result; </script>
<div> <p id="local-1"></p> <p id="local-2"></p> </div> <script> let text = "Hello World!"; document.getElementById("local-1").innerHTML = "text : " + text; let result = text.toUpperCase(); document.getElementById("local-2").innerHTML = "text to uppercase : " + result; </script>