--- title: DOMTokenList slug: Web/API/DOMTokenList translation_of: Web/API/DOMTokenList ---
{{APIRef("DOM")}}{{gecko_minversion_header("1.9.2")}}
DOMTokenList
介面表示了一個以空格作為分隔的內容集,通常來自 {{domxref("Element.classList")}}、{{domxref("HTMLLinkElement.relList")}}、{{domxref("HTMLAnchorElement.relList")}} 或 {{domxref("HTMLAreaElement.relList")}} 等屬性。本介面與 {{jsxref("Array")}} 同樣是由 0
開始索引,且 DOMTokenList
是區分大小寫的。
This interface doesn't inherit any property.
integer
representing the number of objects stored in the object.This interface doesn't inherit any method.
true
if the underlying string contains token, otherwise false
true
if a given token is in the associated attribute's supported tokens.Specification | Status | Comment |
---|---|---|
{{SpecName("DOM WHATWG", "#interface-domtokenlist", "DOMTokenList")}} | {{Spec2("DOM WHATWG")}} | Initial definition |
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | 10 | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
Feature | Android | Android Webview | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|
Basic support | {{CompatUnknown}} | {{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatVersionUnknown}} |