-
Notifications
You must be signed in to change notification settings - Fork 8k
/
index.md
52 lines (33 loc) · 1.21 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
---
title: String.prototype.bold()
slug: Web/JavaScript/Reference/Global_Objects/String/bold
---
{{JSRef}} {{deprecated_header}}
O método **`bold()`** cria um elemento HTML [\<b>](/pt-BR/docs/Web/HTML/Element/b) que faz com que uma string seja exibida em negrito.
## Sintaxe
```
str.bold()
```
### Valor retornado
Uma string contendo um elemento HTML [\<b>](/pt-BR/docs/Web/HTML/Element/b) .
## Descrição
O método `bold()` cria uma string dentro de uma tag `<b>`:
`"<b>str</b>"`.
## Exemplos
### Usando `bold()`
Os exemplos abaixo usam métodos do objeto [String](/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/String#M%C3%A9todos_gen%C3%A9ricos_de_Strings) para alterar a formatação de uma 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
{{Specifications}}
## Compatibilidade com navegadores
{{Compat}}
## Veja também
- {{jsxref("String.prototype.blink()")}}
- {{jsxref("String.prototype.italics()")}}
- {{jsxref("String.prototype.strike()")}}