From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/fr/web/api/window/find/index.html | 78 +++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 files/fr/web/api/window/find/index.html (limited to 'files/fr/web/api/window/find') diff --git a/files/fr/web/api/window/find/index.html b/files/fr/web/api/window/find/index.html new file mode 100644 index 0000000000..9ce279fc62 --- /dev/null +++ b/files/fr/web/api/window/find/index.html @@ -0,0 +1,78 @@ +--- +title: Window.find() +slug: Web/API/Window/find +tags: + - API + - HTML DOM + - Méthode + - NeedsCompatTable + - NeedsContent + - Non-standard + - Reference + - Window + - find +translation_of: Web/API/Window/find +--- +
{{ApiRef}}{{Non-standard_Header}}
+ +
+

Note: La prise en charge de Window.find() pourrait changer dans les futures versions de Gecko. Voir {{Bug("672395")}}.

+
+ +

La méthode Window.find() trouve une chaîne dans une fenêtre.

+ +

Syntaxe

+ +
window.find(aString, aCaseSensitive, aBackwards, aWrapAround,
+            aWholeWord, aSearchInFrames, aShowDialog);
+ +
+
aString
+
La chaîne de caractère à rechercher.
+
aCaseSensitive
+
{{jsxref("Boolean")}}. Si true, spécifie une recherche sensible à la casse.
+
aBackwards
+
{{jsxref("Boolean")}}. Si true, spécifie une recherche vers l'arrière.
+
aWrapAround
+
{{jsxref("Boolean")}}. Si true, spécifie une recherche enveloppante.
+
aWholeWord {{Unimplemented_Inline}}
+
{{jsxref("Boolean")}}. Si true, spécifie une recherche de mot entier. Ceci n'est pas implémenté; voir {{bug(481513)}}.
+
aSearchInFrames
+
{{jsxref("Boolean")}}. Si true, spécifie une recherche dans les cadres.
+
+ +

Retourne

+ +

true si la chaîne est trouvé; autrement, false.

+ +

Exemple

+ +

JavaScript

+ +
findString = function findText(text) {
+  alert("String \x22" + text + "\x22 found? " + window.find(text));
+}
+ +

HTML

+ +
<p>Apples, Bananas, and Oranges.</p>
+<button type="button" onClick='findString("Apples")'>Search for Apples</button>
+<button type="button" onClick='findString("Banana")'>Search for Banana</button>
+<button type="button" onClick='findString("Orange")'>Search for Orange</button>
+
+ +

Résultat

+ +

{{EmbedLiveSample("Example")}}

+ +

Notes

+ +

Dans certains navigateurs, Window.find() sélectionne (met en évidence) le contenu trouvé sur le site.

+ +

Spécification

+ +

Cela ne fait partie d'aucune spécification.

+ +

Compatibilité des navigateurs

+ +

Cette méthode fonctionne dans de nombreux navigateurs modernes, notamment Firefox, Chrome, et Safari.

-- cgit v1.2.3-54-g00ecf