Latest web development tutorials

JavaScript toUpperCase () method

String Object Reference JavaScript String Object

Definition and Usage

toUpperCase () method is used to convert a string to uppercase.

grammar

string.toUpperCase()


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support toUpperCase () method


Examples

Examples

Convert a string to uppercase:

<script>

var str="Hello world!";
document.write(str.toUpperCase());

</script>

try it"


String Object Reference JavaScript String Object