String.fontsize() : fontsize « String « JavaScript Tutorial






Syntax

string.fontsize(num)
    string.fontsize(string2)

The fontsize() method sets the SIZE attribute of an instance of the tag.

This attribute can be a number between 1 and 7.

If you pass the method the number in the form of a string, the size displayed is relative to the tag.

<html>
    <script language="JavaScript">
    <!--
    var myString = new String("Hello, World!");

    document.write("Size=6: " + myString.fontsize(6));
    document.write("<br>Size=-2: " + myString.fontsize('-2'));
    document.close();
    -->

    </script>
</html>








6.14.fontsize
6.14.1.String.fontsize()