back to Overview

.select()

Executes a selector with the list as context.
Web module only.

Syntax Variants

list.select(selector)
list.select(selector, childrenOnly)

Parameters

selector
a selector or any other valid first argument for $().
childrenOnly (optional)
if set, only direct children of the context nodes are included in the list. Children of children will be filtered out. If omitted or not true, all descendants of the context will be included.
(return value)
the new list containing the selected descendants.

Description

Executes a selector with the list as context. list.select(selector, childrenOnly) is equivalent to $(selector, list, childrenOnly).

Example

Returns a list of all list elements:

var parents = $('ol.myList').select('li', true);

Example

Returns a list of all child elements:

var children = $('.myElements').select('*', true);

See also..

  • only() executes a selector on the list elements, instead of their descendants.

Comments

comments powered by Disqus

back to Overview

Functions