JavaScript String sub()

❮ JavaScript String Reference

Example

let text = "Hello World!";
let result = text.sub();
Try it Yourself »

Description

String sub() is deprecated in JavaScript.

Avoid using it.

It may cease to work in your browser at any time.

The sub() method returns a string embedded in a <sub> tag:

<sub>string</sub>


Syntax

string.sub()

Parameters

NONE

Return Value

A string embedded in a <sub> tag.

❮ JavaScript String Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.