Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

JavaScript fontsize() Method

JavaScript fontsize() Method

String Object Reference 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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the fontsize() method.


Example

Example

Display a string at a specified size:

Try it »


String Object Reference JavaScript String object