Skip to main content
Version: v0.0.3

Function: text()

text(el): string | undefined

Concatenated text content of an element with leading/trailing whitespace trimmed, or undefined when there is no non-whitespace text. Does not decode or interpret embedded base64, base64 stays quarantined as inert text.

Parameters

el

Element

Returns

string | undefined

Example

import { text } from "@cosyte/ccda";
text(titleEl); // "Allergies" | undefined