We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

Deprecated
This feature has been removed from the Web standards. Though some browsers may still support it, it is in the process of being dropped. Avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

El mètode strike() crea un elemet HTML <strike> que fa que el string que es mostrarà aparegui ratllat.

Sintaxi

str.strike()

Descripció

The strike() method embeds a string in a <strike> tag: "<strike>str</strike>".

Exemples

Utilitzar strike()

L'exemple següent utilitza mètodes de string per a canviar la forma en que un string és formatat.

var worldString = 'Hello, world'; 

console.log(worldString.blink()); // <blink>Hello, world</blink> 
console.log(worldString.bold()); // <b>Hello, world</b> 
console.log(worldString.italics()); // <i>Hello, world</i> 
console.log(worldString.strike()); // <strike>Hello, world</strike>

Especificacions

Especificació Estat Comentaris
ECMAScript 2015 (6th Edition, ECMA-262)
The definition of 'String.prototype.strike' in that specification.
Standard Definició inicial. Implementat a JavaScript 1.0. Definit a (la normativa) Annex B per a característiques adicionals de l'ECMAScript per a navegadors web.

Compatibilitat amb navegadors

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Característica Chrome Firefox (Gecko) Internet Explorer Opera Safari
Suport bàsic (Yes) 1.0 (1.7 or earlier) (Yes) (Yes) (Yes)
Característica Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Suport bàsic (Yes) (Yes) 1.0 (1.0) (Yes) (Yes) (Yes)

Vegeu també

Document Tags and Contributors

Contributors to this page: enTropy
Last updated by: enTropy,