?
This document uses PHP Chinese website manual Release
JScript? | 語言參考 |
把帶有 COLOR 屬性的一個 HTML <FONT> 標(biāo)記放置在 String 對象中的文本兩端。
strVariable.fontcolor(colorVal)
strVariable
必選項(xiàng)。任意的 String 對象或文字。
colorVal
必選項(xiàng)。為包含顏色值的字符串值??梢允穷伾氖M(jìn)制值,或預(yù)先定義好的顏色名字。
下面的示例說明了 fontcolor 方法:
var strVariable = "This is a string";
strVariable = strVariable.fontcolor("red");
最后一條語句執(zhí)行完后,strVariable 的值是:
<FONT COLOR="RED">This is a string</FONT>
有效的預(yù)定義顏色名取決于 JScript 主機(jī)(瀏覽器、服務(wù)器,等等)。它們也可能由主機(jī)版本的不同而不同。詳細(xì)信息請查閱主機(jī)的說明書。
不檢查該標(biāo)記是否已經(jīng)被應(yīng)用于該字符串了。
版本 1
fontsize 方法 | String 對象的方法 | String 對象的屬性
應(yīng)用于: String 對象