String strike() Method - Javascript String

Javascript examples for String:strike


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>



Return Value:

A string embedded in the <strike> tag

The following code shows how to Display a struck-out string:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

function myFunction() {//from  w w  w  .  java  2  s  . c om
    var str = "Hello World!";
    var result = str.strike();
    document.getElementById("demo").innerHTML = result;


Related Tutorials