Latest web development tutorials

JavaScript sup () method

String Object Reference JavaScript String Object

Definition and Usage

sup () method is used to display the string as superscript.

The method returns a string join the <sup> tag, as follows:

<Sup> string </ sup>

grammar

string.sup()


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support sup () method.


Examples

Examples

The text string displayed as standard:

<script>

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

</script>

try it"


String Object Reference JavaScript String Object