code: function(element, name) {
          var names = element.className;
          return (!!names && new RegExp("(^|\\s)" + name + "(\\s|$)").test(names));
      }
docs: Function: hasClass
  Tests if an element has the given CSS class name.
  
  Parameters:
  element - {DOMElement} A DOM element node.
  name - {String} The CSS class name to search for.
  
  Returns:
  {Boolean} The element has the given class name.