The selectAll
method works just like the select
method, but the is on element.root.querySelectorAll
instead.
query
- type string - an element selector. Example: '.any-class', '#any-id'.
this.selectAll('.any-class')
// or
element.selectAll('.any-class')
That method can receive a generic when used with typescript, this generic must extends HTMLElement
and if not passed it uses the HTMLElement
type and the type used is always set as an Array of this generic:
this.selectAll<HTMLInputElement>('.my-input') // return the element with correct typing