From 52c12c1c3a8a92091f5caadf2cd1cc632b345d39 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Sun, 18 Jul 2021 23:58:20 +0900 Subject: Web/API/CSSStyleDeclaration 以下を更新 (#1482) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Web/API/CSSStyleDeclaration/cssText を新規翻訳 2021/06/13 時点の英語版に基づき新規翻訳 * Web/API/CSSStyleDeclaration 以下を整備 Web/API/CSSStyleDeclaration 以下について、2021/07/10時点の内容に同期。未翻訳の記事については新規翻訳 --- .../ja/web/api/cssstyledeclaration/item/index.html | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 files/ja/web/api/cssstyledeclaration/item/index.html (limited to 'files/ja/web/api/cssstyledeclaration/item/index.html') diff --git a/files/ja/web/api/cssstyledeclaration/item/index.html b/files/ja/web/api/cssstyledeclaration/item/index.html new file mode 100644 index 0000000000..0ee3b526f3 --- /dev/null +++ b/files/ja/web/api/cssstyledeclaration/item/index.html @@ -0,0 +1,50 @@ +--- +title: CSSStyleDeclaration.item() +slug: Web/API/CSSStyleDeclaration/item +tags: +- API +- CSSOM +- Method +- Reference +browser-compat: api.CSSStyleDeclaration.item +translation_of: Web/API/CSSStyleDeclaration/item +--- +

{{ APIRef("CSSOM") }}

+ +

CSSStyleDeclaration.item() メソッドインターフェイスは、位置を指定して {{domxref('CSSStyleDeclaration')}} の CSS プロパティ名を返します。このメソッドは与えた値による例外が発生しません。位置が範囲外だった場合は空文字列が返され、引数が与えられなかった場合は TypeError が発生します。

+ +

構文

+ +
var propertyName = style.item(index);
+
+ +

引数

+ + + +

返値

+ + + +

JavaScript には、 NodeList から位置を指定して項目を取得するための簡単な特別な構文があります。 +

+ +
var propertyName = style[index];
+
+ +

+ +
var style = document.getElementById('div1').style;
+var propertyName = style.item(1); // または style[1] - リスト中の 2 番目のスタイルを返します
+ +

仕様書

+ +{{Specifications}} + +

ブラウザーの互換性

+ +

{{Compat}}

-- cgit v1.2.3-54-g00ecf