The fontsize() method can display a string in a specified size.
The fontsize() method can display a string in a specified size.
This method returns the string embedded in the <font> tag, like this:
<font size="size">string</font>
string.fontsize(size)
Parameter | Require | Description |
---|---|---|
size | Required. | An integer between 1 and 7 that specifies the font size |
A string embedded in the <font> tag
Display the text in a large font-size:
//display a string in a specified size. var str = "Hello World!"; var result = str.fontsize(7); console.log(result);/* w w w . j a v a 2 s . com*/