Elementals.js

Latest Version: 2.0 RC 3 14 March 2017

Method _.nodeEachAll

Iterates through all nodes inside the passed Element that matches the mask, passing that node to a callback function.

Calling Convention:
_.nodeEachAll(Element, callback[, nodeMask || tagName])
Parameters:
Element
The Element that all nodes matching the mask inside of will be run past the callbackfunction.
callback
A function handler for all matching nodes inside Element
nodeMask optional

A bitwise mask used to filter the results. See the Node Masking page for more information.

If omitted, a mask of 1 (matching for nodeType 1) is used.

tagName optional
A tagName to match. When used instead of a nodeMask only elements of node type 1 with a matching tagName will be counted.
Returns:
Nothing

Example

JavaScript

var test = document.getElementById('test');
_.nodeEachAll(
	_d.getElementByID('test'),
	function(e) {
		console.log(e.tagName);
	}
);

Will output the name of every tag contained inside #test as the default mask is nodeType 1.