aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/cssstyledeclaration/getpropertycssvalue/index.html
blob: f3ce66652db48dc31cecb514c78dab98cd83d51c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
title: CSSStyleDeclaration.getPropertyCSSValue()
slug: Web/API/CSSStyleDeclaration/getPropertyCSSValue
tags:
  - API
  - CSSOM
  - Method
  - Obsolete
  - Reference
translation_of: Web/API/CSSStyleDeclaration/getPropertyCSSValue
---
<p>{{ APIRef("CSSOM") }} {{Obsolete_header}}</p>

<p><span class="seoSummary"><strong>CSSStyleDeclaration.getPropertyCSSValue()</strong> メソッドインターフェイスは、プロパティの CSS 値を含む {{domxref('CSSValue')}} を返します。</span> プロパティ名が省略プロパティの場合は <code>null</code> を返すことに注意して下さい。</p>

<p>代わりに {{domxref("CSSStyleDeclaration.getPropertyValue()")}} を使用する必要があります。</p>

<h2 id="構文">構文</h2>

<pre class="syntaxbox notranslate">var <em>value</em> = <em>style</em>.getPropertyCSSValue(<em>property</em>);</pre>

<h3 id="パラメータ">パラメータ</h3>

<ul>
 <li><em><code>property</code></em> は、取得するプロパティ名を表す {{domxref('DOMString')}} です。</li>
</ul>

<h3 id="返り値">返り値</h3>

<ul>
 <li><code><em>value</em></code> は、プロパティの CSS 値を含む {{domxref('CSSValue')}} です。存在しない場合は <code>null</code> を返します。</li>
</ul>

<h2 id="例"></h2>

<p>次の JavaScript コードは、 <code>color</code> CSS プロパティの計算された RGB 値を含むオブジェクトを取得します:</p>

<pre class="brush: js notranslate">var style = window.getComputedStyle(elem, null);
var rgbObj = style.getPropertyCSSValue('color').getRGBColorValue();
</pre>

<h2 id="仕様">仕様</h2>

<table>
 <thead>
  <tr>
   <th scope="col">仕様</th>
   <th scope="col">ステータス</th>
   <th scope="col">備考</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('DOM2 Style', 'css.html#CSS-CSSStyleDeclaration', 'CSSStyleDeclaration')}}</td>
   <td>{{Spec2('DOM2 Style')}}</td>
   <td><a href="https://lists.w3.org/Archives/Public/www-style/2003Oct/0347.html">2003年7月</a>に廃止と宣言</td>
  </tr>
 </tbody>
</table>

<h2 id="ブラウザー実装状況">ブラウザー実装状況</h2>



<p>{{Compat("api.CSSStyleDeclaration.getPropertyCSSValue")}}</p>