need help replicating jQuery's addClass function
<p>I would like to replicate jQuery's addClass function using plain javascript
So far, I have made this function:</p>

<pre><code>function addClass(el,cl){
el.className+=(el.className?' ':'')+cl
}
</code></pre>

<p>It works well, but It uses this syntax:</p>

<pre><code>addClass(element,class)
</code></pre>

<p>I want it to use this syntax:</p>

<pre><code>element.addClass(class)
</code></pre>

<p>How can I do that?</p>

<p>thanks :)</p>
