JavaScript sub() Method
JavaScript String object
Definition and Usage
The sub() method is used to display a string as a subscript.
This method returns a string with the tag added, as shown below:
string
Syntax
string
.sub()
Browser support





All major browsers support the sub() method.
Example
Example
Display the string as a subscript:
Try it »
JavaScript String object