Could be `$('<a>', {'href': ..., 'class': klass}).text(crates[i])` if you felt like (ab)using jQuery's full power. ;P