JavaScript String toUpperCase() method : The toUpperCase() method is used to convert the string to the upper case. It returns the new string as in upper case letters. It doesn't change the original string.
Syntax of toUpperCase() method :
string.toUpperCase()
Example of toUpperCase() method :
To string to lowercase letters, click on button.
<button onclick="convertLowerCase()">convert</button>
<p id="container"></p>
<script>
function convertLowerCase() {
var str = "It is my turn!";
var result = str.toUpperCase();
document.getElementById("container").innerHTML = result;
}
</script>
</body>
</html>
Output : IT IS MY TURN!
0 Comment(s)