Easy Tutorial
❮ Jsref Map Prop Audio Ended ❯

JavaScript fontcolor() Method


Definition and Usage

The fontcolor() method is used to display a string in a specified color.

This method returns a string with the <font> tag added, as shown below:

<font color="colorvalue">string</font>

Syntax

Parameter Description
color Required. Specifies the font-color for the string. The value must be a color name (red), an RGB value (rgb(255,0,0)), or a hexadecimal number (#FF0000).

Browser Support

All major browsers support the fontcolor() method.


Example

Display a string in green:

❮ Jsref Map Prop Audio Ended ❯