最新的Web開發教程
 

JavaScript串sup() Method

<JavaScript字符串參考

顯示字符串作為標文本:

var str = "Hello World!";
var result = str.sup();
試一試»

更多"Try it Yourself"下面的例子。


定義和用法

sup()方法不標準,並預期在所有的瀏覽器可能無法正常工作。

sup()方法被用來顯示一字符串作為標文本。

此方法返回嵌入在字符串<sup>標籤,這樣的:

<SUP>字符串</ SUP>


瀏覽器支持

方法
sup()

句法

參數
沒有。

技術細節

返回值: 嵌入在一個字符串<sup>標籤
JavaScript的版本: 1.0

例子

更多示例

相關方法的演示:

var txt = "Hello World!";

document.write("The original string: " + txt);
document.write("<p>Big: " + txt.big() + "</p>");
document.write("<p>Small: " + txt.small() + "</p>");
document.write("<p>Bold: " + txt.bold() + "</p>");
document.write("<p>Italic: " + txt.italics() + "</p>");
document.write("<p>Fixed: " + txt.fixed() + "</p>");
document.write("<p>Strike: " + txt.strike() + "</p>");
document.write("<p>Fontcolor: " + txt.fontcolor("green") + "</p>");
document.write("<p>Fontsize: " + txt.fontsize(6) + "</p>");
document.write("<p>Subscript: " + txt.sub() + "</p>");
document.write("<p>Superscript: " + txt.sup() + "</p>");
document.write("<p>Link: " + txt.link("http://www.w3ii.com") + "</p>");
document.write("<p>Blink: " + txt.blink() + " (works only in Opera)</p>");
試一試»

<JavaScript字符串參考