select()
Selects an item or a collection of items.
The method accepts a single argument in the following forms:
HTMLElement
HTMLCollection
NodeList
Number
- the index of the selectable item in theitems
arrayObject
- a reference to theitem
stored in theitems
arrayArray
- an array ofHTMLElement
, indexes or item references
Selecting single items
Selecting multiple items
Using indexes
NOTE: If selecting an item via an index, you must pass the index as the node would appear in the collection of selectable items, NOT the element's position relative to it's sibling elements.
Select the first, second and third items
Last updated