aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/cssstyledeclaration/removeproperty/index.html
blob: a1a2600d10ced9b6e495e9dd5666fbb4ab289f6f (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
---
title: CSSStyleDeclaration.removeProperty()
slug: Web/API/CSSStyleDeclaration/removeProperty
tags:
- API
- CSSOM
- Method
- Reference
browser-compat: api.CSSStyleDeclaration.removeProperty
translation_of: Web/API/CSSStyleDeclaration/removeProperty
---
<p>{{ APIRef("CSSOM") }}</p>

<p><strong><code>CSSStyleDeclaration.removeProperty()</code></strong> メソッドインターフェイスは、 CSS スタイル宣言オブジェクトからプロパティを削除します。</p>

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

<pre
  class="brush: js">var <em>oldValue</em> = <em>style</em>.removeProperty(<em>property</em>);</pre>

<h3 id="Parameters">引数</h3>

<ul>
  <li><em><code>property</code></em>{{domxref('DOMString')}} で、削除するプロパティ名を表します。なお、複数語からなるプロパティ名はハイフン区切りであって、キャメルケースではありません。</li>
</ul>

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

<ul>
  <li><code><em>oldValue</em></code>{{domxref('DOMString')}} で、削除される前の CSS プロパティの値と等しいものです。</li>
</ul>

<h3 id="Exceptions">例外</h3>

<ul>
  <li>{{domxref('DOMException')}} NO_MODIFICATION_ALLOWED_ERR: プロパティまたは宣言ブロックが読取専用の場合。</li>
</ul>

<h2 id="Example"></h2>

<p>次の JavaScript コードは、 CSS の <code>background-color</code> プロパティをセレクター規則から削除します。</p>

<pre class="brush: js">var declaration = document.styleSheets[0].rules[0].style;
var oldValue = declaration.removeProperty('background-color');
</pre>

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

{{Specifications}}

<h2 id="Browser_compatibility">ブラウザーの互換性</h2>

<p>{{Compat}}</p>