diff --git a/lib/domutils.js b/lib/domutils.js index e4b1f57..26eeced 100644 --- a/lib/domutils.js +++ b/lib/domutils.js @@ -257,17 +257,14 @@ var Modules = (function (modules) { var i = tagNames.length; while(i--) { - if(node.name === tagNames[i]) { - var attr = this.getAttribute(node, attributeName); - if(attr && attr !== '') { - return attr; - } + if(node.tagName.toLowerCase() === tagNames[i]) { + if (this.hasAttribute(node, attributeName)) + return this.getAttribute(node, attributeName); } } return null; }, - /** * get node if has no siblings CSS :only-child *