JavaScript String - strike() Method



Description

This method causes a string to be displayed as struck-out text, as if it were in a <strike> tag.

Syntax

Its syntax is as follows −

string.strike( )

Return Value

Returns the string with <strike> tag.

Example

Try the following example.

<html> <head> <title>JavaScript String strike() Method</title> </head> <body> <script type = "text/javascript"> var str = new String("Hello world"); alert(str.strike()); </script> </body> </html>

Output

<strike>Hello world</strike>
javascript_strings_object.htm
Advertisements