This method causes a string to be displayed as struck-out text, as if it were in a <strike> tag.
Its syntax is as follows −
string.strike( )
Returns the string with <strike> tag.
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>
<strike>Hello world</strike>