最新的Web開發教程
 

JavaScript串strike() Method

<JavaScript字符串參考

顯示被撞擊出的字符串:

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

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


定義和用法

strike()方法被用來顯示被剔除的字符串。

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

<擊>字符串</擊>

<strike>標籤不支持HTML5。 使用CSS來代替。


瀏覽器支持

方法
strike()

句法

參數
沒有。

技術細節

返回值: 嵌入在一個字符串<strike>標籤
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字符串參考