JavaScript strike()Method

String 对象参考手册JavaScript String Object

Definition and Usage

The strike() method is used to display a string with a strikethrough.

This method returns the string wrapped in a <strike> tag, as follows:

<strike>string</strike>

Syntax

string.strike()


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the strike() method.


Examples

Examples

Display a string with a strikethrough:

<script>

var str = "Hello world!";
document.write(str.strike());

</script>

Try it Yourself »


String 对象参考手册JavaScript String Object Other Extensions