11.12.2012 Views

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Table 7-6: HTML-Releated String Methods<br />

Method Description Example<br />

<br />

element using<br />

the provided<br />

string.<br />

blink() Creates a<br />

blinking text<br />

element<br />

enclosed by<br />

out<br />

of the provided<br />

string despite<br />

Internet<br />

Explorer's lack<br />

of support for<br />

the <br />

element.<br />

bold() Creates a bold<br />

text element<br />

indicated by<br />

out of the<br />

provided<br />

string.<br />

fixed() Creates a<br />

fixed width text<br />

element<br />

indicated by<br />

out of<br />

the<br />

provided<br />

string.<br />

fontcolor(color) Creates a<br />

tag<br />

with the color<br />

specified by<br />

the argument<br />

color. <strong>The</strong><br />

value passed<br />

should be a<br />

valid<br />

hexadecimal<br />

string value or<br />

a string<br />

specifying a<br />

color name.<br />

Fontsize(size) Takes the<br />

argument<br />

specified by<br />

size that<br />

should be<br />

either in the<br />

range 1–7 or a<br />

relative +/–<br />

// Grow<br />

var x = "Bad Netscape".blink();<br />

// Bad Netscape<br />

var x = "Behold!".bold();<br />

// Behold!<br />

var x = "Code".fixed();<br />

// Code<br />

var x = "green".font("green");<br />

// Green<br />

var x = "Red".font("#FF0000");<br />

// Red<br />

var x = "Change size".font(7);<br />

// Change size<br />

var x = "Change size".font("+1");<br />

// Change size

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!