JavaScript Reference/Javascript Methods

Материал из Web эксперт

Перейти к: навигация, поиск

Содержание

"fontColor()" Example

 
<html>
<body>
<button onclick="var myS = new String("Sample String"); 
                 document.write("regular string"+myS.fontcolor("blue"));">
 
change the font color</button>
</body>
</html>



"fontColor()" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |String                                                        |
+----------------+--------------------------------------------------------------+



"fontColor()" Syntax, Parameters and Note

Note:
Returns a string in the specified color.
 
Syntax:
 
stringName.fontColor(param1)
Parameters:
    param1   Required; web color name or hexadecimal value in #RRGGBB format.



"fontSize()" Example

 
<html>
<body>
<button onclick="var myS = new String("Sample String"); 
                 document.write("regular string"+myS.fontsize(7));">
                 change the string font size
</button>
</body>
</html>



"fontSize()" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |String                                                        |
+----------------+--------------------------------------------------------------+



"fontSize()" Syntax, Parameters and Note

Note:
Returns a string in the specified font size.
 
Syntax:
 
stringName.fontSize(param1)
Parameters:
    param1   Required; a number between 1 and 7.