Home > Web Front-end > JS Tutorial > body text

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

WBOY
Release: 2016-05-16 16:33:29
Original
1975 people have browsed it

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...




Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template