From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../objets_globaux/string/strike/index.html | 83 ++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 files/fr/web/javascript/reference/objets_globaux/string/strike/index.html (limited to 'files/fr/web/javascript/reference/objets_globaux/string/strike') diff --git a/files/fr/web/javascript/reference/objets_globaux/string/strike/index.html b/files/fr/web/javascript/reference/objets_globaux/string/strike/index.html new file mode 100644 index 0000000000..e53530aa1f --- /dev/null +++ b/files/fr/web/javascript/reference/objets_globaux/string/strike/index.html @@ -0,0 +1,83 @@ +--- +title: String.prototype.strike() +slug: Web/JavaScript/Reference/Objets_globaux/String/strike +tags: + - Deprecated + - HTML wrapper methods + - JavaScript + - Méthode + - Prototype + - Reference + - String +translation_of: Web/JavaScript/Reference/Global_Objects/String/strike +--- +
{{JSRef}}{{deprecated_header}}
+ +

La méthode strike() permet de créer un élément HTML {{HTMLElement("strike")}} qui permet d'afficher la chaîne comme un texte barré.

+ +

Syntaxe

+ +
str.strike()
+ +

Valeur de retour

+ +

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

+ +

Description

+ +

Cette méthode encadre la chaîne de caractères dans une balise <strike> :
+ "<strike>str</strike>"

+ +

Exemples

+ +

Les méthodes suivantes peuvent être utilisées pour modifier le formatage d'une chaîne de caractères :

+ +
var worldString = "Coucou monde";
+
+console.log(worldString.blink());
+console.log(worldString.bold());
+console.log(worldString.italics());
+console.log(worldString.strike());
+ +

Cela produira le code HTML suivant dans la console :

+ +
<blink>Coucou monde</blink>
+<b>Coucou monde</b>
+<i>Coucou monde</i>
+<strike>Coucou monde</strike>
+ +

Spécifications

+ + + + + + + + + + + + + + + + + + + +
SpécificationÉtatCommentaires
{{SpecName('ES6', '#sec-string.prototype.strike', 'String.prototype.strike')}}{{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.strike', 'String.prototype.strike')}}{{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.strike")}}

+ +

Voir aussi

+ + -- cgit v1.2.3-54-g00ecf