JavaScript fontsize() Method
JavaScript String object
Definition and Usage
The fontsize() method is used to display a string at a specified size.
This method returns the string with an A string wrapped in the tag, as shown below:
string
Syntax
string
.fontsize(size)
| Parameters | Description |
|---|---|
| size | Required. The size parameter must be a number from 1 to 7. |
Browser support





All major browsers support the fontsize() method.
Example
Example
Display a string at a specified size:
Try it »
JavaScript String object