sup()

The sup() method will convert the string value to an instance of the HTML SUP tag. That is, the string will be displayed by the browser as if it were enclosed within the opening and closing SUP tags. SUP stands for SuperScript, and is used to display text which will appear slightly above the bottom edge of the surrounding, normal text. The exponent number of an exponential notation is SuperScripted, for example.

syntax:

string.sup()

EXAMPLE

supString = new String("-3");

document.write("The exponent is 10 X 10" + supString.sup() );

The example shows the creation of a new string, supString. It is then used within a document.write statement along with the sup() method to display the "-3" value of supString in a SuperScripted version of the chosen font. The output should look as follows:



The exponent is 10 X 10-3