Chrome error: Uncaught SyntaxError: <unknown message reserved_word>
<p>Okay heres my problem:</p>

<p>Im trying to extend the dom but for one of my prototype functions, it throws an error.
The error is for the function hasClass. I used the reserved word Element earlier in that script so i dont understand why he is throwing the error only there?</p>

<pre><code>Element.prototype.hasClass = function (class) {
    return this.className.match(new RegExp('(\\s|^)'+class+'(\\s|$)'));
}

Element.prototype.addClass = function (class) {
    this.className = this.className + " " + class;
}

Element.prototype.removeClass = function (class) {
    if (this.hasClass(class)) {
        var reg = new RegExp('(\\s|^)'+class+'(\\s|$)');
        this.className = this.className.replace(reg,' ');
    }
}
</code></pre>
