Add class to an element
<p>I try to write these code to make grid view through CSS:( jsbin )</p>

<pre><code>   var tables = document.getElementsByClassName('tableData');
    var rows = tables[0].getElementsByTagName('tr');
for(var i=1; i&lt;rows.length; i +=2) {
  alert(rows[i]);
  rows[i].className = "alt";
}
</code></pre>

<p>This only works with the tr elements has <code>class=""</code>  . But if I want to add class to tr .
I've tried Core.addClass but it doesn't work .</p>

<p>​</p>
