A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/dom/DOMTokenList/length below:

length ยท WebPlatform Docs

length Summary

Returns the number of tokens in a DOMTokenList.

Property of dom/DOMTokenListdom/DOMTokenList

Syntax

Note: This property is read-only.

var result = element.length;
Return Value

Returns an object of type NumberNumber

Examples
//returns the number of classes in an element's classList (a DOMTokenList)
function elNumClasses(elid) {
  var classes = document.getElementById(elid).classList;
  return classes.length;
}
Related specifications
W3C DOM4
Candidate Recommendation

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4