I have this array of rects using jQuery and Raphael:
squares = [];
for (i = 0; i < 2; ++i) {
var square = paper.rect(0 + 100*i, 0, 70, 70);
square.node.idx = i;
square.node.setAttribute('class', 'foo');
squares.push(square);
}
I can successfully query various attributes, like:
alert(squares[0].attr('x'));
or
alert(squares[0].attr('width'));
but not:
alert(squares[0].attr('class'));
Is there a special reason for which this is not valid? Is there an (other) way to query the class attribute?
Thanks, Adrian