Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

select

Select the first element that matches the specified selector string. If no elements match the selector, returns an empty selection. If multiple elements match the selector, only the first matching element (in document order) will be selected.

The first generic "GElement" refers to the type of element to be selected. The second generic "OldDatum" refers to the type of the datum, on the selected element. This is useful when re-selecting an element with a previously set, know datum type.

function select<GElement extends BaseType, OldDatum>(selector: string): Selection<GElement, OldDatum, HTMLElement, any>;
function select<GElement extends BaseType, OldDatum>(node: GElement): Selection<GElement, OldDatum, null, undefined>;
§
select<GElement extends BaseType, OldDatum>(selector: string): Selection<GElement, OldDatum, HTMLElement, any>
[src]

Select the first element that matches the specified selector string. If no elements match the selector, returns an empty selection. If multiple elements match the selector, only the first matching element (in document order) will be selected.

The first generic "GElement" refers to the type of element to be selected. The second generic "OldDatum" refers to the type of the datum, on the selected element. This is useful when re-selecting an element with a previously set, know datum type.

§Type Parameters

§
GElement extends BaseType
[src]
§
OldDatum
[src]

§Parameters

§
selector: string
[src]

CSS selector string

§Return Type

§
Selection<GElement, OldDatum, HTMLElement, any>
[src]
§
select<GElement extends BaseType, OldDatum>(node: GElement): Selection<GElement, OldDatum, null, undefined>
[src]

Select the specified node element.

The first generic "GElement" refers to the type of element to be selected. The second generic "OldDatum" refers to the type of the datum, on the selected element. This is useful when re-selecting an element with a previously set, know datum type.

§Type Parameters

§
GElement extends BaseType
[src]
§
OldDatum
[src]

§Parameters

§
node: GElement
[src]

An element to be selected

§Return Type

§
Selection<GElement, OldDatum, null, undefined>
[src]