JavaScript Reference/Javascript Methods

Материал из Web эксперт
Перейти к: навигация, поиск

"fontColor()" Example

   <source lang="javascript">
   

<html> <body> <button onclick="var myS = new String("Sample String");

                document.write("regular string"+myS.fontcolor("blue"));">
                

change the font color</button> </body> </html>


     </source>
   
  


"fontColor()" is applied to

   <source lang="javascript">

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

     </source>
   
  


"fontColor()" Syntax, Parameters and Note

   <source lang="javascript">

Note: Returns a string in the specified color.

Syntax:

stringName.fontColor(param1) Parameters:

   param1   Required; web color name or hexadecimal value in #RRGGBB format.
   
     
     </source>
   
  


"fontSize()" Example

   <source lang="javascript">
   

<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>


     </source>
   
  


"fontSize()" is applied to

   <source lang="javascript">

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

     </source>
   
  


"fontSize()" Syntax, Parameters and Note

   <source lang="javascript">

Note: Returns a string in the specified font size.

Syntax:

stringName.fontSize(param1) Parameters:

   param1   Required; a number between 1 and 7.
   
     
     </source>