public function hasClass(DOMElement $element, $class)
    {
        // Get current class
        $itemClass = trim($this->attr($element, 'class'));

        // Check if class already exists
        $classes = explode(' ', $itemClass);

        return in_array($class, $classes);
    }