JavaScript tutorial:
sup method

 

The sup method places the HTML <SUP> tags around text in a String object.

Syntax

strVariable.sup( )
"String Literal".sup( )

Return

None

Example

The following example demonstrates how the sup method works:

<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function supTag()
{
var strVariable = "This is a sup text";
strVariable = strVariable.sup( );
return strVariable;
}

</SCRIPT></HEAD>
<BODY>
<P> See how it work in Html
<SCRIPT LANGUAGE="JavaScript"> document.write(supTag());</SCRIPT> </P>
</BODY>

  To run the code, paste it into JavaScript Editor, save as htm file format and click the Show Internal View button.

See also: String Object methods, String Object properties, sub method