Easy Tutorial
❮ Event Onabort Media Event Altkey ❯

JavaScript sub() Method


Definition and Usage

The sub() method is used to display a string as subscript.

This method returns the string with the <sub> tag, as shown below:

<sub>string</sub>

Syntax


Browser Support

All major browsers support the sub() method.


Example

Display a string as subscript:


❮ Event Onabort Media Event Altkey ❯