diff options
Diffstat (limited to 'files/ru/web/api/domstringmap')
-rw-r--r-- | files/ru/web/api/domstringmap/index.html | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/files/ru/web/api/domstringmap/index.html b/files/ru/web/api/domstringmap/index.html new file mode 100644 index 0000000000..bea01845fe --- /dev/null +++ b/files/ru/web/api/domstringmap/index.html @@ -0,0 +1,99 @@ +--- +title: DOMStringMap +slug: Web/API/DOMStringMap +tags: + - API +translation_of: Web/API/DOMStringMap +--- +<p>{{ APIRef("HTML DOM") }}</p> + +<p><span class="seoSummary">Used by the {{ htmlattrxref("dataset") }} HTML attribute to represent data for custom attributes added to elements.</span></p> + +<h2 id="Доступные_методы">Доступные методы</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="Методы">Методы</h2> + +<h3 id="hasDataAttr()">hasDataAttr()</h3> + +<pre class="eval">boolean hasDataAttr( + in DOMString prop +); +</pre> + +<h4 id="Аргументы">Аргументы</h4> + +<dl> + <dt><code>prop</code></dt> + <dd>The property for which to check for the existence of a value.</dd> +</dl> + +<h4 id="Возвращаемое_значение">Возвращаемое значение</h4> + +<p><code>true</code> if the property exists; otherwise <code>false</code>.</p> + +<h3 id="removeDataAttr()">removeDataAttr()</h3> + +<pre class="eval">void removeDataAttr( + in DOMString prop +); +</pre> + +<h4 id="Parameters">Parameters</h4> + +<dl> + <dt><code>prop</code></dt> + <dd>The property to remove from the data set.</dd> +</dl> + +<h3 id="removeProp()">removeProp()</h3> + +<p>Removes the property from the dataset object. Used to update the dataset object when data-* attribute has been removed from the element.</p> + +<pre class="eval">void removeProp( + in nsIAtom attr +); +</pre> + +<h4 id="Parameters_2">Parameters</h4> + +<dl> + <dt><code>attr</code></dt> + <dd>The property to remove from the dataset.</dd> +</dl> + +<h2 id="Поддержка_браузерами">Поддержка браузерами</h2> + +<p> </p> + +<div class="hidden"> +<p>The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a>and send us a pull request.</p> +</div> + +<p>{{Compat("api.DOMStringMap")}}</p> + +<h2 id="См._далее">См. далее</h2> + +<ul> + <li>{{ domxref("HTMLElement.dataset") }}</li> + <li>{{ htmlattrxref("dataset") }}</li> +</ul> |