Possible Duplicate:
adding classes (serially numbered) to each DIV on page automatically via javascript?
I want to add a class which “numbers” all the <div>s, problem is, is that it overrides the existing classes.
$('div').attr('class', function(i) {
return 'someClass' + i;
});
Or: