Fix dom.text() returning textContent

This commit is contained in:
Raymond Hill 2022-11-12 10:35:40 -05:00
parent feaa338678
commit 3d24b89078
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -81,7 +81,11 @@ class dom {
}
static text(target, text) {
for ( const elem of normalizeTarget(target) ) {
const targets = normalizeTarget(target);
if ( text === undefined ) {
return targets.length !== 0 ? targets[0].textContent : undefined;
}
for ( const elem of targets ) {
elem.textContent = text;
}
}