Skip to content
This repository was archived by the owner on Dec 17, 2021. It is now read-only.

Files

Latest commit

 

History

History
31 lines (19 loc) · 463 Bytes

gettextnodes.md

File metadata and controls

31 lines (19 loc) · 463 Bytes

DOM/getTextNodes()

This function finds and returns all text nodes within an element.

Import

import getTextNodes from '@web-native-js/play-ui/src/dom/getTextNodes.js';

Syntax

getTextNodes(el);

Parameters

  • el - HTMLElement: The source DOM element.

Return

  • Array - The text nodes found.

Usage

let textNodes = getTextNodes(document.body);
console.log(textNodes); // Array