Z.byTag(...)

byTag(t: string): Z.Base[];

Gets an array of nodes with the given tag.

Tags can be set in the Properties panel of a node or using the pushTag(...) function.

Parameters

Parameter Type Description
t string The tag to search for.

Returns

An array of nodes with the given tag.

Example

// Populate the redArray variable with an array of nodes that have the 'RED' tag assigned to them.
var redArray = Z.byTag("RED");

// Store the number of red objects within a 'count' variable
var count = redArray.length;
zapcode branded_zapcode i