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/hasattributes/index.html | 79 ----------------------- files/fr/web/api/element/hasattributes/index.md | 79 +++++++++++++++++++++++ 2 files changed, 79 insertions(+), 79 deletions(-) delete mode 100644 files/fr/web/api/element/hasattributes/index.html create mode 100644 files/fr/web/api/element/hasattributes/index.md (limited to 'files/fr/web/api/element/hasattributes') diff --git a/files/fr/web/api/element/hasattributes/index.html b/files/fr/web/api/element/hasattributes/index.html deleted file mode 100644 index ec7c62931f..0000000000 --- a/files/fr/web/api/element/hasattributes/index.html +++ /dev/null @@ -1,79 +0,0 @@ ---- -title: element.hasAttributes -slug: Web/API/Element/hasAttributes -tags: - - API - - DOM - - Element - - Méthode - - Reference - - polyfill -translation_of: Web/API/Element/hasAttributes ---- -
{{ApiRef("DOM")}}
- -

La méthode hasAttributes(), rattachée à l'interface {{domxref("Element")}}, renvoie une valeur booléenne indiquant si le nœud courant a au moins un attribut ou non.

- -

Syntaxe

- -
var result = element.hasAttributes();
- -

Valeur de retour

- -
-
result
-
contient la valeur de retour true ou false.
-
- -

Exemple

- -
var foo = document.getElementById("foo");
-if (foo.hasAttributes()) {
-    // faire quelque chose avec 'foo.attributes'
-}
- -

Polyfill

- -
;(function(prototype) {
-    prototype.hasAttributes = prototype.hasAttributes || function() {
-        return (this.attributes.length > 0);
-    }
-})(Element.prototype);
- -

Spécifications

- - - - - - - - - - - - - - - - - - - - - - - - -
SpécificationStatutCommentaire
{{SpecName("DOM WHATWG", "#dom-element-hasattributes", "Element.hasAttributes()")}}{{Spec2('DOM WHATWG')}}Déplacé de l'interface {{domxref("Node")}} vers l'interface plus spécialisée {{domxref("Element")}}.
{{SpecName('DOM3 Core','#ID-NodeHasAttrs','hasAttributes()')}}{{Spec2('DOM3 Core')}}Pas de changement par rapport à {{SpecName("DOM2 Core")}}
{{SpecName('DOM2 Core','#ID-NodeHasAttrs','hasAttributes()')}}{{Spec2('DOM2 Core')}}Définition initiale, sur l'interface {{domxref("Node")}}.
- -

Compatibilité des navigateurs

- -

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

- -

Voir aussi

- - diff --git a/files/fr/web/api/element/hasattributes/index.md b/files/fr/web/api/element/hasattributes/index.md new file mode 100644 index 0000000000..ec7c62931f --- /dev/null +++ b/files/fr/web/api/element/hasattributes/index.md @@ -0,0 +1,79 @@ +--- +title: element.hasAttributes +slug: Web/API/Element/hasAttributes +tags: + - API + - DOM + - Element + - Méthode + - Reference + - polyfill +translation_of: Web/API/Element/hasAttributes +--- +
{{ApiRef("DOM")}}
+ +

La méthode hasAttributes(), rattachée à l'interface {{domxref("Element")}}, renvoie une valeur booléenne indiquant si le nœud courant a au moins un attribut ou non.

+ +

Syntaxe

+ +
var result = element.hasAttributes();
+ +

Valeur de retour

+ +
+
result
+
contient la valeur de retour true ou false.
+
+ +

Exemple

+ +
var foo = document.getElementById("foo");
+if (foo.hasAttributes()) {
+    // faire quelque chose avec 'foo.attributes'
+}
+ +

Polyfill

+ +
;(function(prototype) {
+    prototype.hasAttributes = prototype.hasAttributes || function() {
+        return (this.attributes.length > 0);
+    }
+})(Element.prototype);
+ +

Spécifications

+ + + + + + + + + + + + + + + + + + + + + + + + +
SpécificationStatutCommentaire
{{SpecName("DOM WHATWG", "#dom-element-hasattributes", "Element.hasAttributes()")}}{{Spec2('DOM WHATWG')}}Déplacé de l'interface {{domxref("Node")}} vers l'interface plus spécialisée {{domxref("Element")}}.
{{SpecName('DOM3 Core','#ID-NodeHasAttrs','hasAttributes()')}}{{Spec2('DOM3 Core')}}Pas de changement par rapport à {{SpecName("DOM2 Core")}}
{{SpecName('DOM2 Core','#ID-NodeHasAttrs','hasAttributes()')}}{{Spec2('DOM2 Core')}}Définition initiale, sur l'interface {{domxref("Node")}}.
+ +

Compatibilité des navigateurs

+ +

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

+ +

Voir aussi

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