Dynamic Web Development with Seaside

21.2.2Refining Queries

After you made an initial query you can refine the result with additional operations. All existing operations are described in this section:

Siblings

Get a set of elements containing all of the unique siblings of each of the matched set of elements.

aQuery siblings.
aQuery siblings: 'div'.

Next Siblings

Get a set of elements containing the unique next siblings of each of the given set of elements.

aQuery next.
aQuery next: 'div'.

Or, find all sibling elements after the current element.

aQuery nextAll.
aQuery nextAll: 'div'.

Or, find all following siblings of each element up to but not including the element matched by the selector.

aQuery nextUntil: 'div'.

Previous Siblings

Get a set of elements containing the unique previous siblings of each of the matched set of elements.

aQuery previous.
aQuery previous: 'div'.

Or, find all sibling elements in front of the current element.

aQuery previousAll.
aQuery previousAll: 'div'.

Or, find all previous siblings of each element up to but not including the element matched by the selector.

aQuery previousUntil: 'div'.

Children

Get a set of elements containing all of the unique immediate children of each of the matched set of elements.

aQuery children.
aQuery children: 'div'.

Find all the child nodes inside the matched elements (including text nodes), or the content document, if the element is an iframe.

aQuery contents.

Searches for all elements that match the specified expression.

aQuery find: 'div'.

Parents

Get a set of elements containing the unique parents of the matched set of elements.

aQuery parent.
aQuery parent: 'div'.

Or, find all following siblings of each element up to but not including the element matched by the selector.

aQuery parents.
aQuery parents: 'div'.

Or, find all the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector.

qQuery parentsUntil: 'div'.

Get a set of elements containing the closest parent element that matches the specified selector, the starting element included.

aQuery closest.
aQuery closest: 'div'.
§
jQuery Basics
Performing Actions
Creating Queries
This is a draft chapter.

Copyright © 19 March 2024 Stéphane Ducasse, Lukas Renggli, C. David Shaffer, Rick Zaccone
This book is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 license.

This book is published using Seaside, Magritte and the Pier book publishing engine.