String.fontsize() : fontsize : String JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » String » fontsize »

 

String.fontsize()











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>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo String
» fontsize