Skip to main content

getElementValue()

getElementValue<T>(child, transform, recursive): T

Extracts and returns the value of an HTML element's attributes.

Type parameters

Type parameterValue
T extends Record<string, any>Record<string, any>

Parameters

ParameterTypeDefault valueDescription
childHTMLElementundefinedThe HTML element to extract values from.
transform{ [K in string | number | symbol]?: Function }{}-
recursivebooleantrueWhether to recursively extract values from child elements. Default is true.

Returns

T

An object containing the extracted values.