String.prototype.strike()
Deprecated
Avoid using this feature in new projects. HTML wrapper methods exist only for backwards compatibility. Use DOM APIs to create elements instead. This feature may be a candidate for removal from web standards or browsers.>
Consider using the following features instead: DOM.>
O método strike() cria um elemento HTML <strike> que faz com que uma string seja exibida com o texto riscado.
Sintaxe
str.strike()
Valor retornado
Uma string contendo um elemento HTML <strike>.
Descrição
O método strike() cria uma string dentro uma tag <strike>: "<strike>str</strike>".
Exemplos
>Usando strike()
O exemplo a seguir usa métodos do objeto global String para alterar a formatação da string:
js
var worldString = "Olá, mundo";
console.log(worldString.blink()); // <blink>Olá, mundo</blink>
console.log(worldString.bold()); // <b>Olá, mundo</b>
console.log(worldString.italics()); // <i>Olá, mundo</i>
console.log(worldString.strike()); // <strike>Olá, mundo</strike>
Especificações
| Specification |
|---|
| ECMAScript® 2027 Language Specification> # sec-string.prototype.strike> |