Query Flags

When selecting elements the Enchant library will automatically select the first of its type. Flags are useful for selecting specific elements, or elements in a particular order or range.

To demonstrate this I will be using the css method to illuminate the results each flag outputs. All flags are indexed at 0 and up.

Note: not all methods will work with certain flag types, I will list what methods accept what flags in the documentation.

No Flags:

All Flag:

​

Odd Flag:

Even Flag:

Single Flag:

The Single flag also includes {last} which will select the last node.

​

And Flag:

The And flag also includes {last} which will select the last node.

Range Flag:

The Range flag also includes {last} which will select the last node.

​