我們要開始學習內建的 JavaScript 對象,以及如何使用它們。從下一節開始,我們將具體依序講解的這些內建的 JavaScript 物件。 1、 字串物件 範例1:計算字串長度 <br/> <br/>var txt="Hello World type="text/javascript"> <br/> <br/>var txt="Hello World World!" .length) <br/> <br/> <br/> <br/>var txt="Hello World!" <br/> <br/>document.write("<p>Big: " + txt.big() + "") <br/>document.write("<p>Small: " + txt.small() + "") <br/> <br/>document.write("<p>Bold: " + txt.bold() + "") <br/>document.write("<p>Italic : " + txt.italics() + "") <br/> <br/>document.write("<p>Blink: " + txt.blink() + " (does not work in IE)") <br/>document.write("<p>Fixed: " + txt.fixed() + "") <br/>document.write("<p>Strike: " + txt.strike() + " ") <br/> <br/>document.write("<p>Fontcolor: " + txt.fontcolor("Red") + "") <br/>document.write("<p>Fontsize: " + txt.fontsize(16.fontsize(16. ) + "") <br/> <br/>document.write("<p>Lowercase: " + txt.toLowerCase() + "") <br/>document.write("<p>Uppercase: " + txt .toUpperCase() + "") <br/> <br/>document.write("<p>Subscript: " + txt.sub() + "") <br/>document.write("<p>Superscript: " + txt.sup() + "") <br/> <br/>document.write("<p>Link: " + txt.link("http://www.w3school.com.cn") + "< /p>") <br/>