Skip to content


A sequence is a function that, given an HTML element, selects a series of new elements and outputs a value for each of these elements. In this sense, they're similar to an HTML selector that, given a page, selects a series of elements on the page, except that sequences can also perform actions on the page, or even navigate away before selecting any new elements.

Sequences can select zero or more elements, and since a sequence takes an element and selects other elements, they can be chained together into new, tree-like sequences. The do-block statement provides an easy way to chain sequences together by placing sequences one above another. These sequences are evaluated top to bottom, and then flattened into a single level sequence.