JavaScript sub () method
Definition and Usage
sub () method is used to display the string as a subscript.
The method returns a string added <sub> tag, as follows:
<Sub> string </ sub>
grammar
string.sub()
Browser Support
All major browsers support sub () method
Examples
Examples
The string is displayed as subscript:
<script>
var str = "Hello world!";
document.write(str.sub());
</script>
var str = "Hello world!";
document.write(str.sub());
</script>
try it"
JavaScript String Object