From 5fab0a1eb99e87aa141adb3777d92c69437ae971 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Wed, 2 Mar 2022 22:49:44 +0900 Subject: Element 以下の a-g で始まるプロパティを移行 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/ja/web/api/element/getattributens/index.html | 47 ---------------------- 1 file changed, 47 deletions(-) delete mode 100644 files/ja/web/api/element/getattributens/index.html (limited to 'files/ja/web/api/element/getattributens/index.html') diff --git a/files/ja/web/api/element/getattributens/index.html b/files/ja/web/api/element/getattributens/index.html deleted file mode 100644 index ee03de1cab..0000000000 --- a/files/ja/web/api/element/getattributens/index.html +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: element.getAttributeNS -slug: Web/API/Element/getAttributeNS -tags: - - DOM - - Gecko - - 翻訳中 -translation_of: Web/API/Element/getAttributeNS ---- -

{{ ApiRef("DOM") }}

- -

概要

- -

getAttributeNS は指定の名前空間と名前の属性の文字列値を返します。もし指定の名前の属性が存在しなければ、戻り値は null または ""(空文字列) のいずれかとなります。詳細は{{ Anch("注記") }} を参照。

- -

構文

- -
attrVal =element.getAttributeNS(namespace,name)
-
- -

引数

- - - -

- -
var div1 = document.getElementById("div1");
-var a = div1.getAttributeNS("www.mozilla.org/ns/specialspace/",
-                            "special-align");
-alert(a); // div の align 属性の値を表示します。
-
- -

注記

- -

getAttributeNSgetAttribute と異なります。getAttributeNS は特定の名前空間に属している要求された属性をより深く特定することができます。上記の例では、属性は mozilla の架空の "specialspace" 名前空間に属しています。

- -

DOM4 より前の仕様では、このメソッドは属性が存在しない場合に null ではなく空文字列を返すように指定されていました。しかし、ほとんどのウェブ・ブラウザは null を返していました。DOM4 以降は、仕様でも null を返すように指定されました。しかしながら、いくつかの古いウェブ・ブラウザは空文字列を返します。そのため、指定の要素に指定の属性が存在しない可能性があるなら getAttributeNS を呼ぶ前に hasAttributeNS を使用して属性の存在を確かめる必要があります。

- -

{{ DOMAttributeMethods() }}

- -

仕様

- -

DOM Level 2 Core: getAttributeNS

-- cgit v1.2.3-54-g00ecf