0.0.4 • Published 4 years ago

html-text-content v0.0.4

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

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');
}