源代碼
點擊運行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>教程</title> </head> <body> <script> var txt = "Hello World!"; document.write("<p>字體變大: " + txt.big() + "</p>"); document.write("<p>字體縮小: " + txt.small() + "</p>"); document.write("<p>字體加粗: " + txt.bold() + "</p>"); document.write("<p>斜體: " + txt.italics() + "</p>"); document.write("<p>固定定位: " + txt.fixed() + "</p>"); document.write("<p>加刪除線: " + txt.strike() + "</p>"); document.write("<p>字體顏色: " + txt.fontcolor("green") + "</p>"); document.write("<p>字體大小: " + txt.fontsize(6) + "</p>"); document.write("<p>下標: " + txt.sub() + "</p>"); document.write("<p>上標: " + txt.sup() + "</p>"); document.write("<p>鏈接: " + txt.link("http://www.w3cschool.cc") + "</p>"); document.write("<p>閃動文本: " + txt.blink() + " (不能用於IE,Chrome,或者Safari)</p>"); </script> </body> </html>
運行結果