Mike Taylor, Opera Software
A collection is an object that represents a lists of DOM nodes. A collection can be either live or static. Unless otherwise stated, a collection must be live.
interface NodeList {
getter Node? item(unsigned long index);
readonly attribute unsigned long length;
};
Node.childNodes
document.getElementsByName
document.getElementsByTagName
document.getElementsByTagNameNS
document.links
document.getElementsByName
document.getElementsByClassName
element.getElementsByClassName
document.querySelectorAll*
element.querySelectorAll*
*static NodeList
interface HTMLCollection {
readonly attribute unsigned long length;
getter Element? item(unsigned long index);
getter object? namedItem(DOMString name);
};
HTMLAllCollection, HTMLFormControlsCollection, HTMLOptionsCollection, HTMLPropertiesCollection
document.anchors
document.applets
document.forms
document.images
document.links
formElement.elements
selectElement.options
tableElement.rows
tableElement.tBodies
tableRowElement.cells
document.embeds
document.plugins
document.scripts
document.all*
*obsolete but awesome
var item = document.getItems("http://itemtype/URL")[0]
item.properties.foo
item.getValues()
The DOMTokenList interface represents an interface to an underlying string that consists of a set of space-separated tokens.
interface DOMTokenList {
readonly attribute unsigned long length;
getter DOMString? item(unsigned long index);
boolean contains(DOMString token);
void add(DOMString token);
void remove(DOMString token);
boolean toggle(DOMString token);
};
*View Source. Go crazy.interface DOMTokenList {
readonly attribute unsigned long length;
getter DOMString? item(unsigned long index);
boolean contains(DOMString token);
void add(DOMString token);
void remove(DOMString token);
boolean toggle(DOMString token);
};
The DOMStringMap interface represents a set of name-value pairs.
interface DOMStringMap {
getter DOMString (DOMString name);
setter void (DOMString name, DOMString value);
creator void (DOMString name, DOMString value);
deleter void (DOMString name);
};
Mike Taylor, Opera Software