html-text-content
v0.0.4
Published
Check for text in html element
Downloads
2
Maintainers
Readme
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');
}