Javascript tutorial

Page 178

Javascript

Try the following example. <html> <head> <title>JavaScript String fixed() Method</title> </head> <body> <script type="text/javascript"> var str = new String("Hello world"); alert(str.fixed()); </script> </body> </html>

Output <tt>Hello world</tt>

fontColor () This method causes a string to be displayed in the specified color as if it were in a <font color="color"> tag.

Syntax Its syntax is as follows: string.fontColor( color)

Attribute Details color: A string expressing the color as a hexadecimal RGB triplet or as a string literal.

Return Value Returns the string with <font color="color"> tag.

Example Try the following example. <html> 168


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.