diff --git a/src/dom.js b/src/dom.js index 05ccefe..7a608b8 100644 --- a/src/dom.js +++ b/src/dom.js @@ -294,11 +294,8 @@ Element.Methods = { hasClassName: function(element, className) { if (!(element = $(element))) return; var elementClassName = element.className; - if (elementClassName.length == 0) return false; - if (elementClassName == className || - elementClassName.match(new RegExp("(^|\\s)" + className + "(\\s|$)"))) - return true; - return false; + return (elementClassName.length > 0 && (elementClassName == className || + elementClassName.match(new RegExp("(^|\\s)" + className + "(\\s|$)")))); }, addClassName: function(element, className) {