$w.ContainableMixin

$w.ContainableMixin

Provides functionality for elements that can contain other elements. Some elements, such as pages, headers, footers, and boxes, can contain other elements. This occurs when you drag an element onto a container element and attach it. These attached elements are considered the parent element's children. Some actions performed on the parent, such as hiding, affect the element's children as well.

Contents

children Gets an array of the elements that are contained within the element.
children

children

Gets an array of the elements that are contained within the element.

Syntax

get children(): Element[]

Description

Some elements, such as pages, headers, footers, and boxes, can contain other elements. This occurs when you drag an element onto a container element and attach it. These attached elements are considered the parent element's children.

Type

Element[ ]

Examples

Get an element's children

bGV0IG15Q2hpbGRyZW4gPSAkdygiI215Q29udGFpbmVyIikuY2hpbGRyZW47CgpsZXQgZmlyc3RDaGlsZCA9IG15Q2hpbGRyZW5bMF07Cg==
let myChildren = $w("#myContainer").children;

let firstChild = myChildren[0];

Default Value

An empty array

See Also

parent