I am getting the child nodes of en element and i want to check if the tags can actually contain text. For example:
,
use that:
canContainText: function(node) { if(node.nodeType === 3){ return true; } if(node.nodeType === 1){ return /<[^>]+><\/[^>]+>/gi.test(document.createElement(node.nodeName.toLowerCase())).outerHTML; } }