Question: In the Maven Standard Directory Layout where do I put Rules Engine files? Specifically, I'm using JBoss Rules (Drools), if that matters.

Answer: 
You can check whether `element.className` matches `/\bthatClass\b/`.  

`\b` matches a word break.

Or, you can use jQuery's own implementation:

```
var className = " " + selector + " ";
if ( (" " + element.className + " ").replace(/[\n\t]/g, " ").indexOf(" thatClass ") > -1 ) 

```

To answer your more general question, you can look at jQuery's [source code](https://github.com/jquery/jquery) on github or at the source for [`hasClass` specifically in this source viewer](http://james.padolsey.com/jquery/#v=1.5.0&fn=jQuery.fn.hasClass).
hasClass function:

```js
HTMLElement.prototype.hasClass = function(cls) {
    var i;
    var classes = this.className.split(" ");
    for(i = 0; i < classes.length; i++) {
        if(classes[i] == cls) {
            return true;
        }
    }
    return false;
};

```

addClass function:

```js
HTMLElement.prototype.addClass = function(add) {
    if (!this.hasClass(add)){
        this.className = (this.className + " " + add).trim();
    }
};

```

removeClass function:

```js
HTMLElement.prototype.removeClass = function(remove) {
    var newClassName = "";
    var i;
    var classes = this.className.replace(/\s{2,}/g, ' ').split(" ");
    for(i = 0; i < classes.length; i++) {
        if(classes[i] !== remove) {
            newClassName += classes[i] + " ";
        }
    }
    this.className = newClassName.trim();
};

```