This method displays the string using a specified font size, as if contained within HTML <FONT SIZE="fontsize"></FONT> tags.
There are various
methods available that allow you to perform formatting alterations to
the contents of your String object when written to a document.
These methods are:
big, blink, bold, fixed, fontcolor,
fontsize, italics, small, strike, sub
and sup.
myString = new String("Formatting methods")
document.write ("<p>big() = " + myString.big())
document.write ("<br>blink() = " + myString.blink())
document.write ("<br>bold() = " + myString.bold())
document.write ("<br>fixed() = " + myString.fixed())
document.write ("<br>fontcolor("red") = " + myString.fontcolor("red"))
document.write ("<br>fontsize("5") = " + myString.fontsize("5"))
document.write ("<br>small() = " + myString.small())
document.write ("<br>strike() = " + myString.strike())
document.write ("<br>sub() = " + myString.sub())
document.write ("<br>sup() = " + myString.sup())
big() = Formatting methods
blink() =
bold() = Formatting
methods
fixed() = Formatting methods
fontcolor("red")= Formatting methods
fontsize("5") = Formatting
methods
small() = Formatting methods
strike() =
Formatting methods
sub() = Formatting
methods
sup() = Formatting methods
This code writes the contents of the "myString" String object to the document with a different formatting method applied each time it is written.