-
Notifications
You must be signed in to change notification settings - Fork 8.1k
/
index.md
58 lines (38 loc) · 1.51 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
title: String.prototype.strike()
slug: Web/JavaScript/Reference/Global_Objects/String/strike
---
{{JSRef}} {{deprecated_header}}
## Сводка
Метод **`strike()`** создаёт HTML-элемент {{HTMLElement("strike")}}, заставляющий строку отображаться зачёркнутым текстом.
## Синтаксис
```
str.strike()
```
## Описание
Метод `strike()` заключает строку в тег `<strike>`: `"<strike>str</strike>"`.
## Примеры
### Пример: использование метода `strike()`
В следующем примере демонстрируется использование нескольких строковых методов для изменения форматирования строки:
```js
var worldString = "Привет, мир";
document.write(worldString.blink());
document.write(worldString.bold());
document.write(worldString.italics());
document.write(worldString.strike());
```
Этот пример генерирует такой же вывод, как и следующий HTML:
```html
<blink>Привет, мир</blink>
<b>Привет, мир</b>
<i>Привет, мир</i>
<strike>Привет, мир</strike>
```
## Спецификации
{{Specifications}}
## Совместимость с браузерами
{{Compat}}
## Смотрите также
- {{jsxref("String.prototype.blink()")}}
- {{jsxref("String.prototype.bold()")}}
- {{jsxref("String.prototype.italics()")}}