Movatterモバイル変換


[0]ホーム

URL:


  1. Tecnologia Web para desenvolvedores
  2. JavaScript
  3. Referência JavaScript
  4. Objetos Globais
  5. String
  6. String.prototype.bold()

Esta página foi traduzida do inglês pela comunidade.Saiba mais e junte-se à comunidade MDN Web Docs.

View in EnglishAlways switch to English

String.prototype.bold()

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see thecompatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

O métodobold() cria um elemento HTML<b> que faz com que uma string seja exibida em negrito.

Sintaxe

str.bold()

Valor retornado

Uma string contendo um elemento HTML<b> .

Descrição

O métodobold() cria uma string dentro de uma tag<b>:"<b>str</b>".

Exemplos

Usandobold()

Os exemplos abaixo usam métodos do objetoString 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

Specification
ECMAScript® 2026 Language Specification
# sec-string.prototype.bold

Compatibilidade com navegadores

Veja também

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp