Node.js examples for CSS:Class
Utility function to determine if the element has a classname class
/**/*from ww w . ja v a 2 s. co m*/ * Utility function to determine if the ele element has a classname class * @param ele * @param classname * @return - true if ele has classname */ function hasClass(ele, classname) { if ((' '+ele.className+' ').indexOf(' '+classname+' ') > -1) { return true; } else { return false; } }