From c05efa8d7ae464235cf83d7c0956e42dc6974103 Mon Sep 17 00:00:00 2001 From: julieng Date: Sat, 2 Oct 2021 17:20:14 +0200 Subject: move *.html to *.md --- files/fr/web/api/element/hasattribute/index.html | 77 ------------------------ files/fr/web/api/element/hasattribute/index.md | 77 ++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 77 deletions(-) delete mode 100644 files/fr/web/api/element/hasattribute/index.html create mode 100644 files/fr/web/api/element/hasattribute/index.md (limited to 'files/fr/web/api/element/hasattribute') diff --git a/files/fr/web/api/element/hasattribute/index.html b/files/fr/web/api/element/hasattribute/index.html deleted file mode 100644 index 5c90c03771..0000000000 --- a/files/fr/web/api/element/hasattribute/index.html +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: element.hasAttribute -slug: Web/API/Element/hasAttribute -tags: - - API - - DOM - - Element - - Méthode - - Reference -translation_of: Web/API/Element/hasAttribute ---- -

{{APIRef("DOM")}}

- -

La méthode Element.hasAttribute() renvoie une valeur booléenne indiquant si l'élément courant possède l'attribut spécifié ou non.

- -

Syntaxe

- -
var result = element.hasAttribute(name);
-
- -
-
result
-
récupère la valeur de retour true ou false.
-
name
-
est une chaine de caractères représentant le nom de l'attribut.
-
- -

Exemple

- -
var foo = document.getElementById("foo");
-if (foo.hasAttribute("bar")) {
-    // faire quelque chose
-}
- -

Polyfill

- -
;(function(prototype) {
-    prototype.hasAttribute = prototype.hasAttribute || function(name) {
-        return !!(this.attributes[name] &&
-                  this.attributes[name].specified);
-    }
-})(Element.prototype);
- -

Notes

- -

{{DOMAttributeMethods}}

- -

Spécification

- - - - - - - - - - - - - - - - - - - - - - - - -
SpécificationStatutCommentaire
{{SpecName('DOM WHATWG', '#dom-element-hasattribute', 'Element.hasAttribute()')}}{{Spec2('DOM WHATWG')}}Dans {{SpecName('DOM3 Core')}}, déplacé de {{domxref("Node")}} à {{domxref("Element")}}
{{SpecName('DOM3 Core', 'core.html#ID-ElHasAttr', 'Element.hasAttribute()')}}{{Spec2('DOM3 Core')}}Pas de changement par rapport à {{SpecName('DOM2 Core')}}
{{SpecName('DOM2 Core', 'core.html#ID-ElHasAttr', 'Element.hasAttribute()')}}{{Spec2('DOM2 Core')}}Définition initiale.
- -

Browser compatibility

- -

{{Compat("api.Element.hasAttribute")}}

diff --git a/files/fr/web/api/element/hasattribute/index.md b/files/fr/web/api/element/hasattribute/index.md new file mode 100644 index 0000000000..5c90c03771 --- /dev/null +++ b/files/fr/web/api/element/hasattribute/index.md @@ -0,0 +1,77 @@ +--- +title: element.hasAttribute +slug: Web/API/Element/hasAttribute +tags: + - API + - DOM + - Element + - Méthode + - Reference +translation_of: Web/API/Element/hasAttribute +--- +

{{APIRef("DOM")}}

+ +

La méthode Element.hasAttribute() renvoie une valeur booléenne indiquant si l'élément courant possède l'attribut spécifié ou non.

+ +

Syntaxe

+ +
var result = element.hasAttribute(name);
+
+ +
+
result
+
récupère la valeur de retour true ou false.
+
name
+
est une chaine de caractères représentant le nom de l'attribut.
+
+ +

Exemple

+ +
var foo = document.getElementById("foo");
+if (foo.hasAttribute("bar")) {
+    // faire quelque chose
+}
+ +

Polyfill

+ +
;(function(prototype) {
+    prototype.hasAttribute = prototype.hasAttribute || function(name) {
+        return !!(this.attributes[name] &&
+                  this.attributes[name].specified);
+    }
+})(Element.prototype);
+ +

Notes

+ +

{{DOMAttributeMethods}}

+ +

Spécification

+ + + + + + + + + + + + + + + + + + + + + + + + +
SpécificationStatutCommentaire
{{SpecName('DOM WHATWG', '#dom-element-hasattribute', 'Element.hasAttribute()')}}{{Spec2('DOM WHATWG')}}Dans {{SpecName('DOM3 Core')}}, déplacé de {{domxref("Node")}} à {{domxref("Element")}}
{{SpecName('DOM3 Core', 'core.html#ID-ElHasAttr', 'Element.hasAttribute()')}}{{Spec2('DOM3 Core')}}Pas de changement par rapport à {{SpecName('DOM2 Core')}}
{{SpecName('DOM2 Core', 'core.html#ID-ElHasAttr', 'Element.hasAttribute()')}}{{Spec2('DOM2 Core')}}Définition initiale.
+ +

Browser compatibility

+ +

{{Compat("api.Element.hasAttribute")}}

-- cgit v1.2.3-54-g00ecf