Home > Article > Web Front-end > Introductory example of JavaScript strike method (adding strikethrough to string)_Basic knowledge
JavaScript strike method
Thestrike method returns a strikethrough-style string defined using the HTML strike tag attribute. Its syntax is as follows:
strike method instance
Run this example, output:
Tip: This method returns the strikethrough string defined using the HTML strike tag, even though this method cannot directly change the string into a strikethrough string. If you want to dynamically change the element font to a strikethrough string, you can refer to the following example:
Add decorative effects (strikethrough, underline, overline, flash) to font text