html-text-content
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

html-text-content

Check for text in html element

Install

npm install --save html-text-content

Usage

var { hasText } = require('html-text-content');

let div=document.createElement('div');

div.innerHTML='<h1>Big Text</h1><div><font color="#ff0000">Red text</font></div><div><font color="#ff0000"><br></font></div><div><br></div>';

if( hasText(div) ) {
    console.log('Text found');
} else {
    console.log('No text found');
}

/html-text-content/

    Package Sidebar

    Install

    npm i html-text-content

    Weekly Downloads

    3

    Version

    0.0.4

    License

    MIT

    Unpacked Size

    1.66 kB

    Total Files

    4

    Last publish

    Collaborators

    • thekoushik