-
Notifications
You must be signed in to change notification settings - Fork 8k
/
index.md
130 lines (122 loc) · 4.37 KB
/
index.md
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
---
title: MutationRecord
slug: Web/API/MutationRecord
---
{{APIRef("DOM")}}
**`MutationRecord`** は、 DOM に生じた個々の変更を表します。これは {{domxref("MutationObserver")}} のコールバック関数に渡されるオブジェクトです。
## プロパティ
<table class="standard-table">
<tbody>
<tr>
<td class="header">プロパティ</td>
<td class="header">型</td>
<td class="header">意味</td>
</tr>
<tr>
<td>{{domxref("MutationRecord.type")}}</td>
<td><code>String</code></td>
<td>
属性値の変更の場合は <code>"attributes"</code>、<code
>CharacterData</code
>
ノードに対する変更の場合は
<code>"characterData"</code>、ノードのツリーに対する変更の場合は
<code>"childList"</code> を返します。
</td>
</tr>
<tr>
<td>{{domxref("MutationRecord.target")}}</td>
<td>{{domxref("Node")}}</td>
<td>
変更の影響を受けたノードを、
{{domxref("MutationRecord.type")}} に応じて返します。<br /><code
>attributes</code
>
の場合、属性が変更された要素となります。<br /><code>characterData</code>
の場合、<code>CharacterData</code> ノードとなります。<br /><code
>childList</code
>
の場合、子ノードが変更されたノードとなります。
</td>
</tr>
<tr>
<td>{{domxref("MutationRecord.addedNodes")}}</td>
<td>{{domxref("NodeList")}}</td>
<td>
追加されたノードを返します。何もノードが追加されていなかった場合は、空の
{{domxref("NodeList")}} を返します。
</td>
</tr>
<tr>
<td>{{domxref("MutationRecord.removedNodes")}}</td>
<td>{{domxref("NodeList")}}</td>
<td>
削除されたノードを返します。何もノードが削除されていなかった場合は、空の
{{domxref("NodeList")}} を返します。
</td>
</tr>
<tr>
<td>{{domxref("MutationRecord.previousSibling")}}</td>
<td>{{domxref("Node")}}</td>
<td>
追加あるいは削除されたノードの直前にあるノード、もしくは
<code>null</code> を返します。
</td>
</tr>
<tr>
<td>{{domxref("MutationRecord.nextSibling")}}</td>
<td><code>{{domxref("Node")}}</code></td>
<td>
追加あるいは削除されたノードの直後にあるノード、もしくは
<code>null</code> を返します。
</td>
</tr>
<tr>
<td>{{domxref("MutationRecord.attributeName")}}</td>
<td><code>String</code></td>
<td>
変更された属性のローカル名、もしくは <code>null</code> を返します。
</td>
</tr>
<tr>
<td>{{domxref("MutationRecord.attributeNamespace")}}</td>
<td><code>String</code></td>
<td>変更された属性の名前空間、もしくは <code>null</code> を返します。</td>
</tr>
<tr>
<td>{{domxref("MutationRecord.oldValue")}}</td>
<td><code>String</code></td>
<td>
<p>
返値は {{domxref("MutationRecord.type")}}
に応じて以下のように変わります。<br /><code>attributes</code>
の場合、変更された属性の変更前の属性値となります。<br /><code
>characterData</code
>
の場合、変更されたノードの変更前のデータとなります。<br /><code
>childList</code
>
の場合、<code>null</code> となります。
</p>
<div class="note">
<p>
なお、この機能が正常に動作するためには、
<code>MutationObserver</code>
<a href="/ja/docs/Web/API/MutationObserver/observe">observe</a>
メソッドの対応する
<a href="/ja/docs/Web/API/MutationObserverInit"
>MutationObserverInit</a
>
引数で、 <code>attributeOldValue</code> または
<code>characterDataOldValue</code> が
<code>true</code> に設定されている必要があります
</p>
</div>
</td>
</tr>
</tbody>
</table>
## 仕様書
{{Specifications}}
## ブラウザーの互換性
{{Compat}}