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

JavaScript strike方法入门实例(给字符串加上删除线)_基础知识

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

JavaScript strike 方法

strike 方法返回使用 HTML strike 标签属性定义的删除线样式的字符串。其语法如下:

复制代码 代码如下:

str_object.strike()

提示:该方法不符合 ECMA 标准,不建议使用。

strike 方法实例

复制代码 代码如下:


运行该例子,输出:

复制代码 代码如下:

www.jb51.net

提示:该方法返回使用 HTML strike 标签定义的删除线字符串,即使用该方法并不能直接将字符串变更为带删除线的字符串。如果想动态改变元素字体为带删除线的字符串,可参考下面的实例:

给字体文本加上装饰效果(删除线、下划线、上划线、闪烁)

复制代码 代码如下:





无装饰 删除线
下划线 上划线



我是一些文字 ...

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!