From bf8e099b9c8b3c60d60b3712b4fc97b052c39887 Mon Sep 17 00:00:00 2001 From: julieng Date: Tue, 3 Aug 2021 08:03:23 +0200 Subject: convert content to md --- .../reference/global_objects/string/fixed/index.md | 80 +++++++++------------- 1 file changed, 32 insertions(+), 48 deletions(-) (limited to 'files/fr/web/javascript/reference/global_objects/string/fixed') diff --git a/files/fr/web/javascript/reference/global_objects/string/fixed/index.md b/files/fr/web/javascript/reference/global_objects/string/fixed/index.md index c014787858..482010f528 100644 --- a/files/fr/web/javascript/reference/global_objects/string/fixed/index.md +++ b/files/fr/web/javascript/reference/global_objects/string/fixed/index.md @@ -11,63 +11,47 @@ tags: translation_of: Web/JavaScript/Reference/Global_Objects/String/fixed original_slug: Web/JavaScript/Reference/Objets_globaux/String/fixed --- -
{{JSRef}}{{deprecated_header}}
+{{JSRef}}{{deprecated_header}} -

La méthode fixed() permet de créer un élément HTML {{HTMLElement("tt")}}, ce qui permet d'afficher le texte de la chaîne de caractère dans une fonte à chasse fixe.

+La méthode **`fixed()`** permet de créer un élément HTML {{HTMLElement("tt")}}, ce qui permet d'afficher le texte de la chaîne de caractère dans une fonte à chasse fixe. -

Syntaxe

+## Syntaxe -
str.fixed()
+ str.fixed() -

Valeur de retour

+### Valeur de retour -

Une chaîne de caractères représentant un élément HTML {{HTMLElement("tt")}}.

+Une chaîne de caractères représentant un élément HTML {{HTMLElement("tt")}}. -

Description

+## Description -

La méthode fixed() encadre une chaîne de caractères dans une balise <tt> :
- "<tt>str</tt>"

+La méthode `fixed()` encadre une chaîne de caractères dans une balise `` : +`"str`" -

Exemples

+## Exemples -

L'exemple suivant illustre l'utilisation de la méthode fixed pour formater une chaîne de caractères :

+L'exemple suivant illustre l'utilisation de la méthode `fixed` pour formater une chaîne de caractères : -
var worldString = "Coucou monde";
+```js
+var worldString = "Coucou monde";
 
 console.log(worldString.fixed());
-// "<tt>Coucou monde</tt>"
-
- -

Spécifications

- - - - - - - - - - - - - - - - - - - -
SpécificationÉtatCommentaires
{{SpecName('ES6', '#sec-string.prototype.fixed', 'String.prototype.fixed')}}{{Spec2('ES6')}}Définition initiale. Implémentée dans JavaScript 1.0. Définie dans l'annexe B (normative) pour les fonctionnalités ECMAScript additionnelles pour les navigateurs web.
{{SpecName('ESDraft', '#sec-string.prototype.fixed', 'String.prototype.fixed')}}{{Spec2('ESDraft')}}Définie dans l'annexe B (normative) pour les fonctionnalités ECMAScript additionnelles pour les navigateurs web.
- -

Compatibilité des navigateurs

- -

{{Compat("javascript.builtins.String.fixed")}}

- -

Voir aussi

- - +// "Coucou monde" +``` + +## Spécifications + +| Spécification | État | Commentaires | +| ------------------------------------------------------------------------------------------------------------ | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| {{SpecName('ES6', '#sec-string.prototype.fixed', 'String.prototype.fixed')}} | {{Spec2('ES6')}} | Définition initiale. Implémentée dans JavaScript 1.0. Définie dans l'annexe B (normative) pour les fonctionnalités ECMAScript additionnelles pour les navigateurs web. | +| {{SpecName('ESDraft', '#sec-string.prototype.fixed', 'String.prototype.fixed')}} | {{Spec2('ESDraft')}} | Définie dans l'annexe B (normative) pour les fonctionnalités ECMAScript additionnelles pour les navigateurs web. | + +## Compatibilité des navigateurs + +{{Compat("javascript.builtins.String.fixed")}} + +## Voir aussi + +- {{jsxref("String.prototype.bold()")}} +- {{jsxref("String.prototype.italics()")}} +- {{jsxref("String.prototype.strike()")}} -- cgit v1.2.3-54-g00ecf