Reputation: 3594
I'm not having luck getting the syntax correct for combining these jquery lines. Can append be used with attr() or do these just need to be called separately or in the callback? It doesn't have to be append either, it's the only thing writing to that element, I just didn't know any other way of getting text in there.
$('#People').append(array.names[9]);
$('#People').attr({
class: 'blueDescriptorBig'
});
Upvotes: 1
Views: 99
Reputation: 79840
I am not sure if I understood correctly, but see below
$('#People')
.append(array.names[9])
.addClass('blueDescriptorBig'); //Should use addClass instead of .attr for class
Upvotes: 3