The fontsize method places an HTML <FONT> tag with the SIZE attribute around the text in a String object.
Syntax
strVariable.fontsize(intSize)
"String Literal".fontsize(intSize)
The intSize argument is an integer value that determines the size of the text.
Return value
None
Example
The following example demonstrates the fontsize method:
<HEAD> <SCRIPT LANGUAGE="JavaScript"> function FontSizeTag() { var strVariable = "This is a test"; strVariable = strVariable.fontsize(19); return strVariable } </SCRIPT></HEAD> <BODY> <P> See how it work in Html <SCRIPT LANGUAGE="JavaScript"> document.write(FontSizeTag());</SCRIPT> </P> </BODY>
|
To run the code, paste it into JavaScript Editor, save as htm format and click the Show Internal View button.
See also: fontcolor method, String Object methods, String Object properties |