diff options
| author | julieng <julien.gattelier@gmail.com> | 2021-08-03 08:03:23 +0200 |
|---|---|---|
| committer | SphinxKnight <SphinxKnight@users.noreply.github.com> | 2021-09-03 08:08:25 +0200 |
| commit | bf8e099b9c8b3c60d60b3712b4fc97b052c39887 (patch) | |
| tree | c101746d082c9581c94f5937519c7d0e2f4af8cb /files/fr/web/javascript/reference/global_objects/string/bold | |
| parent | 844f5103992238c0c23203286dad16a466e89c97 (diff) | |
| download | translated-content-bf8e099b9c8b3c60d60b3712b4fc97b052c39887.tar.gz translated-content-bf8e099b9c8b3c60d60b3712b4fc97b052c39887.tar.bz2 translated-content-bf8e099b9c8b3c60d60b3712b4fc97b052c39887.zip | |
convert content to md
Diffstat (limited to 'files/fr/web/javascript/reference/global_objects/string/bold')
| -rw-r--r-- | files/fr/web/javascript/reference/global_objects/string/bold/index.md | 96 |
1 files changed, 41 insertions, 55 deletions
diff --git a/files/fr/web/javascript/reference/global_objects/string/bold/index.md b/files/fr/web/javascript/reference/global_objects/string/bold/index.md index 956d34878d..63faf319aa 100644 --- a/files/fr/web/javascript/reference/global_objects/string/bold/index.md +++ b/files/fr/web/javascript/reference/global_objects/string/bold/index.md @@ -11,72 +11,58 @@ tags: translation_of: Web/JavaScript/Reference/Global_Objects/String/bold original_slug: Web/JavaScript/Reference/Objets_globaux/String/bold --- -<div>{{JSRef}}{{deprecated_header}}</div> +{{JSRef}}{{deprecated_header}} -<p>La méthode <code><strong>bold()</strong></code> crée un élément HTML {{HTMLElement("b")}} qui affiche la chaine de caractères en gras.</p> +La méthode **`bold()`** crée un élément HTML {{HTMLElement("b")}} qui affiche la chaine de caractères en gras. -<h2 id="Syntaxe">Syntaxe</h2> +## Syntaxe -<pre class="syntaxbox"><var>str</var>.bold()</pre> + str.bold() -<h3 id="Valeur_de_retour">Valeur de retour</h3> +### Valeur de retour -<p>Une chaîne de caractères représentant un élément HTML {{HTMLElement("b")}}.</p> +Une chaîne de caractères représentant un élément HTML {{HTMLElement("b")}}. -<h2 id="Description">Description</h2> +## Description -<p>La méthode <code>bold()</code> place la chaine de caractères dans une balise <code><b></code> :<br> - <code>"<b>str</b></code>"</p> +La méthode `bold()` place la chaine de caractères dans une balise `<b>` : +`"<b>str</b>`" -<h2 id="Exemples">Exemples</h2> +## Exemples -<p>L'exemple suivant utilise des méthodes de <code>String</code> pour changer l'affichage de la chaine de caractères :</p> +L'exemple suivant utilise des méthodes de `String` pour changer l'affichage de la chaine de caractères : -<pre class="brush:js">var chaîneMonde = "Coucou monde"; +```js +var chaîneMonde = "Coucou monde"; console.log( chaîneMonde.blink() ); console.log( chaîneMonde.bold() ); console.log( chaîneMonde.italics() ); -console.log( chaîneMonde.strike() );</pre> - -<p>Cet exemple produit le même HTML que le code suivant :</p> - -<pre class="brush:html"><blink>Coucou monde</blink> -<b>Coucou monde</b> -<i>Coucou monde</i> -<strike>Coucou monde</strike> -</pre> - -<h2 id="Spécifications">Spécifications</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Spécification</th> - <th scope="col">État</th> - <th scope="col">Commentaires</th> - </tr> - <tr> - <td>{{SpecName('ES6', '#sec-string.prototype.bold', 'String.prototype.bold')}}</td> - <td>{{Spec2('ES6')}}</td> - <td>Définition initiale. Implémentée avec JavaScript 1.0. Définie dans l'annexe B (normative) pour les fonctionnalités additionnelles des navigateurs web.</td> - </tr> - <tr> - <td>{{SpecName('ESDraft', '#sec-string.prototype.bold', 'String.prototype.bold')}}</td> - <td>{{Spec2('ESDraft')}}</td> - <td>Définie dans l'annexe B (normative) pour les fonctionnalités additionnelles des navigateurs web.</td> - </tr> - </tbody> -</table> - -<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2> - -<p>{{Compat("javascript.builtins.String.bold")}}</p> - -<h2 id="Voir_aussi">Voir aussi</h2> - -<ul> - <li>{{jsxref("String.prototype.blink()")}}</li> - <li>{{jsxref("String.prototype.italics()")}}</li> - <li>{{jsxref("String.prototype.strike()")}}</li> -</ul> +console.log( chaîneMonde.strike() ); +``` + +Cet exemple produit le même HTML que le code suivant : + +```html +<blink>Coucou monde</blink> +<b>Coucou monde</b> +<i>Coucou monde</i> +<strike>Coucou monde</strike> +``` + +## Spécifications + +| Spécification | État | Commentaires | +| -------------------------------------------------------------------------------------------------------- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| {{SpecName('ES6', '#sec-string.prototype.bold', 'String.prototype.bold')}} | {{Spec2('ES6')}} | Définition initiale. Implémentée avec JavaScript 1.0. Définie dans l'annexe B (normative) pour les fonctionnalités additionnelles des navigateurs web. | +| {{SpecName('ESDraft', '#sec-string.prototype.bold', 'String.prototype.bold')}} | {{Spec2('ESDraft')}} | Définie dans l'annexe B (normative) pour les fonctionnalités additionnelles des navigateurs web. | + +## Compatibilité des navigateurs + +{{Compat("javascript.builtins.String.bold")}} + +## Voir aussi + +- {{jsxref("String.prototype.blink()")}} +- {{jsxref("String.prototype.italics()")}} +- {{jsxref("String.prototype.strike()")}} |
