JavaScript toUpperCase() | Convert a String to Uppercase

The JavaScript toUpperCase() method converts specified string to uppercase. For example:

HTML with JavaScript Code
<!DOCTYPE html>

   <p id="xyz"></p>

      let myString = "JavaScript is Fun. Is not it?";

      let myUpperString = myString.toUpperCase();
      document.getElementById("xyz").innerHTML = myUpperString;

That is, all the lowercase characters of specified string will be converted into its uppercase equivalent.

JavaScript toUpperCase() Syntax

The syntax of toUpperCase() method in JavaScript is:


The toUpperCase() method does not change the original string. Rather it returns a new string which is the exact copy of the original string, except that, all characters will be in uppercase.

JavaScript Online Test

« Previous Tutorial Next Tutorial »

Like/Share Us on Facebook 😋