blob: df9d74a7bda4ad1b0579c6c2ac7db8c23e3c1922 (
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
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
131
132
133
134
135
136
137
138
139
140
141
|
---
title: DOMStringMap
slug: Web/API/DOMStringMap
translation_of: Web/API/DOMStringMap
---
<p>{{ APIRef("HTML DOM") }}</p>
<p>Usado pelo atributo HTML {{ htmlattrxref("dataset") }} para representar atributos próprios adicionados ao elemento.</p>
<h2 id="Method_overview" name="Method_overview">Visão Geral do Método</h2>
<table class="standard-table">
<tbody>
<tr>
<td><code>DOMString <a href="#getDataAttr()">getDataAttr</a>(in DOMString prop);</code></td>
</tr>
<tr>
<td><code>boolean <a href="#hasDataAttr()">hasDataAttr</a>(in DOMString prop);</code></td>
</tr>
<tr>
<td><code>void <a href="#removeDataAttr()">removeDataAttr</a>(in DOMString prop);</code></td>
</tr>
<tr>
<td><code>void <a href="#removeProp()">removeProp</a>(in nsIAtom attr);</code></td>
</tr>
<tr>
<td><code>void <a href="#setDataAttr()">setDataAttr</a>(in DOMString prop, in DOMString value);</code></td>
</tr>
</tbody>
</table>
<h2 id="Methods" name="Methods">Métodos</h2>
<h3 id="hasDataAttr()">hasDataAttr()</h3>
<pre class="eval">boolean hasDataAttr(
in DOMString prop
);
</pre>
<h6 id="Parameters" name="Parameters">Parâmetros</h6>
<dl>
<dt><code>prop</code></dt>
<dd>Nome da propriedade a qual a existência deve ser verificada.</dd>
</dl>
<h6 id="Return_value" name="Return_value">Retorno</h6>
<p><code>true</code> se a propriedade existir ou <code>false</code> se não existir.</p>
<h3 id="removeDataAttr()">removeDataAttr()</h3>
<pre class="eval">void removeDataAttr(
in DOMString prop
);
</pre>
<h6 id="Parameters" name="Parameters">Parâmetros</h6>
<dl>
<dt><code>prop</code></dt>
<dd>Propriedade a ser removida do data set.</dd>
</dl>
<h3 id="removeProp()">removeProp()</h3>
<p>Remove a propriedade do dataset do objeto. Usada para atualizar o objeto de dataset do objeto quando o atributo data-* houver sido removido do elemento.</p>
<pre class="eval">void removeProp(
in nsIAtom attr
);
</pre>
<h6 id="Parameters" name="Parameters">Parâmetros</h6>
<dl>
<dt><code>attr</code></dt>
<dd>A propriedade a ser removida do dataset.</dd>
</dl>
<h2 id="Compatibilidade">Compatibilidade</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
<table class="compat-table">
<tbody>
<tr>
<th>Feature</th>
<th>Chrome</th>
<th>Edge</th>
<th>Firefox (Gecko)</th>
<th>Internet Explorer</th>
<th>Opera</th>
<th>Safari</th>
</tr>
<tr>
<td>Suporte básico</td>
<td>{{ CompatUnknown() }}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{ CompatGeckoDesktop("6.0") }}</td>
<td>{{ CompatUnknown() }}</td>
<td>{{ CompatUnknown() }}</td>
<td>{{ CompatUnknown() }}</td>
</tr>
</tbody>
</table>
</div>
<div id="compat-mobile">
<table class="compat-table">
<tbody>
<tr>
<th>Feature</th>
<th>Android</th>
<th>Edge</th>
<th>Firefox Mobile (Gecko)</th>
<th>IE Mobile</th>
<th>Opera Mobile</th>
<th>Safari Mobile</th>
</tr>
<tr>
<td>Suporte básico</td>
<td>{{ CompatUnknown() }}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{ CompatUnknown() }}</td>
<td>{{ CompatUnknown() }}</td>
<td>{{ CompatUnknown() }}</td>
<td>{{ CompatUnknown() }}</td>
</tr>
</tbody>
</table>
</div>
<h2 id="Veja_também">Veja também</h2>
<ul>
<li>{{ domxref("HTMLElement.dataset") }}</li>
<li>{{ htmlattrxref("dataset") }}</li>
</ul>
|