aboutsummaryrefslogtreecommitdiff
path: root/files/de/web/api/domtokenlist
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:41:15 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:41:15 -0500
commit4b1a9203c547c019fc5398082ae19a3f3d4c3efe (patch)
treed4a40e13ceeb9f85479605110a76e7a4d5f3b56b /files/de/web/api/domtokenlist
parent33058f2b292b3a581333bdfb21b8f671898c5060 (diff)
downloadtranslated-content-4b1a9203c547c019fc5398082ae19a3f3d4c3efe.tar.gz
translated-content-4b1a9203c547c019fc5398082ae19a3f3d4c3efe.tar.bz2
translated-content-4b1a9203c547c019fc5398082ae19a3f3d4c3efe.zip
initial commit
Diffstat (limited to 'files/de/web/api/domtokenlist')
-rw-r--r--files/de/web/api/domtokenlist/add/index.html73
-rw-r--r--files/de/web/api/domtokenlist/index.html125
2 files changed, 198 insertions, 0 deletions
diff --git a/files/de/web/api/domtokenlist/add/index.html b/files/de/web/api/domtokenlist/add/index.html
new file mode 100644
index 0000000000..2e1b6728c2
--- /dev/null
+++ b/files/de/web/api/domtokenlist/add/index.html
@@ -0,0 +1,73 @@
+---
+title: DOMTokenList.add()
+slug: Web/API/DOMTokenList/add
+translation_of: Web/API/DOMTokenList/add
+---
+<p>{{APIRef("DOM")}}</p>
+
+<p>Die <code><strong>add()</strong></code> Methode des {{domxref("DOMTokenList")}} Interfaces, fügt ein <em>token</em> der Liste an.</p>
+
+<h2 id="Syntax">Syntax</h2>
+
+<pre class="syntaxbox">tokenList.add(token1[, token2[, ...]]);</pre>
+
+<h3 id="Parameter">Parameter</h3>
+
+<dl>
+ <dt>token</dt>
+ <dd>Ein {{domxref("DOMString")}} ,welches das <em>token</em> repräsentiert, welches an die Liste angefügt werden soll.</dd>
+</dl>
+
+<h3 id="Rückgabewert">Rückgabewert</h3>
+
+<p><code>undefined</code></p>
+
+<h2 id="Beispiele">Beispiele</h2>
+
+<p>Im folgenden Beispiel erhalten wir die Liste der Klassen eines {{htmlelement("span")}} Elementes als <code>DOMTokenList</code>  , mit Hilfe von {{domxref("Element.classList")}}. Wir fügen der Liste dann ein neues <em>token</em> an und schreiben die Liste als inhalt in das <code>&lt;span&gt;.</code></p>
+
+<p>Das HTML:</p>
+
+<pre class="brush: html">&lt;span class="a b c"&gt;&lt;/span&gt;</pre>
+
+<p>Nun das JavaScript:</p>
+
+<pre class="brush: js">var span = document.querySelector("span");
+var classes = span.classList;
+classes.add("d");
+span.textContent = classes;
+</pre>
+
+<p>Die Ausgabe:</p>
+
+<p>{{ EmbedLiveSample('Examples', '100%', 60) }}</p>
+
+<p>Man kann auch mehrere <em>tokens</em> auf einmal hinzufügen:</p>
+
+<pre class="brush: js">span.classList.add("d", "e", "f");
+</pre>
+
+<h2 id="Spezifikationen">Spezifikationen</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Spezifikation</th>
+ <th scope="col">Status</th>
+ <th scope="col">Kommentar</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('DOM WHATWG','#dom-domtokenlist-add','add()')}}</td>
+ <td>{{Spec2('DOM WHATWG')}}</td>
+ <td>Initial definition</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_Kompatibilität">Browser Kompatibilität</h2>
+
+<div>
+<div class="hidden">Die Kompatibilitätstabelle auf dieser Seite ist aus strukturierten Daten generiert worden. Wenn du helfen willst, den Datenbestand zu erweitern, besuche <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> und sende uns einen pull - Request.</div>
+
+<p>{{Compat("api.DOMTokenList.add")}}</p>
+</div>
diff --git a/files/de/web/api/domtokenlist/index.html b/files/de/web/api/domtokenlist/index.html
new file mode 100644
index 0000000000..c963c053e0
--- /dev/null
+++ b/files/de/web/api/domtokenlist/index.html
@@ -0,0 +1,125 @@
+---
+title: DOMTokenList
+slug: Web/API/DOMTokenList
+translation_of: Web/API/DOMTokenList
+---
+<p>{{APIRef("DOM")}}{{gecko_minversion_header("1.9.2")}}</p>
+
+<p>Die <code><strong>DOMTokenList </strong></code>Schnittstelle repräsentiert eine Sammlung von durch Leerzeichen getrennte Zeichen/ Merkmale (Tokens). Solch eine Ansammlung wird wiedergegben von {{domxref("Element.classList")}}, {{domxref("HTMLLinkElement.relList")}}, {{domxref("HTMLAnchorElement.relList")}} oder {{domxref("HTMLAreaElement.relList")}}. Deren Index beginnt bei 0 wie bei JavaScript {{jsxref("Array")}} Objekten. <code>DOMTokenList</code> achten immer auf die Groß- und Kleinschreibung.</p>
+
+<h2 id="Eigenschaften">Eigenschaften</h2>
+
+<p>Die Schnittstelle erbt keine Eigenschaften.</p>
+
+<dl>
+ <dt>{{domxref("DOMTokenList.length")}} {{ReadOnlyInline}}</dt>
+ <dd>Ist eine Ganzzahl, die die Anzahl der im Objekt gespeicherten Objekte darstellt.</dd>
+</dl>
+
+<h2 id="Methoden">Methoden</h2>
+
+<p>Diese Schnittstelle erbt keine Methode.</p>
+
+<dl>
+ <dt>{{domxref("DOMTokenList.item()")}}</dt>
+ <dd>Returns an item in the list by its index (or undefined if the number is greater than or equal to the length of the list, prior to {{gecko("7.0")}} returned null)</dd>
+ <dt>{{domxref("DOMTokenList.contains()")}}</dt>
+ <dd>Returns <code>true</code> if the underlying string contains <em>token</em>, otherwise <code>false</code></dd>
+ <dt>{{domxref("DOMTokenList.add()")}}</dt>
+ <dd>Fügt <em>token </em>der Liste hinzu.</dd>
+ <dt>{{domxref("DOMTokenList.remove()")}}</dt>
+ <dd>Removes <em>token</em> from the underlying string</dd>
+ <dt>{{domxref("DOMTokenList.replace()")}}</dt>
+ <dd>Replaces an existing <em>token</em> with a new token.</dd>
+ <dt>{{domxref("DOMTokenList.supports()")}}</dt>
+ <dd>Returns <code>true</code> if a given <em>token</em> is in the associated attribute's supported tokens.</dd>
+ <dt>{{domxref("DOMTokenList.toggle()")}}</dt>
+ <dd>Removes <em>token</em> from string and returns false. If <em>token</em> doesn't exist it's added and the function returns true</dd>
+ <dt>{{domxref("DOMTokenList.entries()")}}</dt>
+ <dd>Returns an {{jsxref("Iteration_protocols","iterator")}} allowing to go through all key/value pairs contained in this object.</dd>
+ <dt>{{domxref("DOMTokenList.forEach()")}}</dt>
+ <dd>Executes a provided function once per <code>DOMTokenList</code> element.</dd>
+ <dt>{{domxref("DOMTokenList.keys()")}}</dt>
+ <dd>Returns an {{jsxref("Iteration_protocols", "iterator")}} allowing to go through all keys of the key/value pairs contained in this object.</dd>
+ <dt>{{domxref("DOMTokenList.values()")}}</dt>
+ <dd>Returns an {{jsxref("Iteration_protocols", "iterator")}} allowing to go through all values of the key/value pairs contained in this object.</dd>
+</dl>
+
+<h2 id="Spezifikationen">Spezifikationen</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName("DOM WHATWG", "#interface-domtokenlist", "DOMTokenList")}}</td>
+ <td>{{Spec2("DOM WHATWG")}}</td>
+ <td>Initial definition</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browserkompatibilität">Browserkompatibilität</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari (WebKit)</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>10</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Android Webview</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Phone</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ <th>Chrome for Android</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="Siehe_auch">Siehe auch</h2>
+
+<ul>
+ <li>{{domxref("DOMSettableTokenList")}} (object that extends DOMTokenList with settable <em>.value</em> property)</li>
+</ul>