Home  >  Article  >  Web Front-end  >  Introductory example of JavaScript strike method (adding strikethrough to string)_Basic knowledge

Introductory example of JavaScript strike method (adding strikethrough to string)_Basic knowledge

WBOY
WBOYOriginal
2016-05-16 16:33:291976browse

JavaScript strike method

The

strike method returns a strikethrough-style string defined using the HTML strike tag attribute. Its syntax is as follows:

Copy code The code is as follows:

str_object.strike()

Tip: This method does not comply with ECMA standards and is not recommended.

strike method instance

Copy code The code is as follows:


Run this example, output:

Copy code The code is as follows:

www.jb51.net

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

Copy code The code is as follows:





No decoration Strikethrough
Underline Overline



I am some text...

Some Text...




Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn