String.fontcolor() : fontcolor : String JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » String » fontcolor »

 

String.fontcolor()










Syntax








string.fontcolor(hexnum)
    string.fontcolor(color)



The fontcolor() method sets the COLOR attribute of an instance of the tag.

This attribute can either be passed as the hexadecimal equivalent of the color or the actual string that represents that color.












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

    document.write("Hex usage: " + myString.fontcolor('FF0000'));
    document.write("<br>Color usage: " + myString.fontcolor('blue'));
    document.close();
    -->
    </script>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo String
» fontcolor