String strike() Method - Javascript String

Javascript examples for String:strike

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>

Parameters

None.

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>
<html>
<body>

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

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

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

</body>
</html>

Related Tutorials