Javascript - String strike() Method

The strike() method displays a string that is struck out.

Description

The strike() method displays a string that is struck out.

This method returns the string embedded in the <strike> tag, like this:

<strike>string</strike>

Syntax

string.strike()

Parameters

None

Return

A string embedded in the <strike> tag

Example

Display a struck-out string:

Demo

//display a string that is struck out.
var str = "Hello World!";
var result = str.strike();
console.log(result);//from   w  w  w . j  a v a 2s  .  co m

Result