The toUpperCase() method is used to convert a string to uppercase.
A new string in which all lowercase characters of stringObject are converted to uppercase characters.
The syntax is: stringObject.toUpperCase()
Example
In this case, "Hello world!" will be displayed in capital letters:
<script type="text/javascript">var str="Hello World!"document.write(str.toUpperCase())</script>
The effects are as follows:
Related methods are as follows:
<html><body><script type="text/javascript">var txt="Hello World!"document.write("<p>Big: " + txt.big() + "</p>")document.write("<p>Small: " + txt.small() + "</p>")document.write("<p>Bold: " + txt.bold() + "</p>")document.write("<p>Italic: " + txt.italics() + "</p>")document.write("<p>Blink: " + txt.blink() + " (does not work in IE)</p>")document.write("<p>Fixed: " + txt.fixed() + "</p>")document.write("<p>Strike: " + txt.strike() + "</p>")document.write("<p>Fontcolor: " + txt.fontcolor("Red") + "</p>")document.write("<p>Fontsize: " + txt.fontsize(16) + "</p>")document.write("<p>Lowercase: " + txt.toLowerCase() + "</p>")document.write("<p>Uppercase: " + txt.toUpperCase() + "</p>")document.write("<p>Subscript: " + txt.sub() + "</p>")document.write("<p>Supscript: " + txt.sup() + "</p>")document.write("<p>Link: " + txt.link(//www.VeVB.COM) + "</p>")</script></body></html>The effects are as follows:
The above is all the content of this article. I hope it will be helpful to everyone's learning and I hope everyone will support Wulin.com more.