Reputation: 1220
I have a object and I attempting to add both the name and description to the html body:
$('div#mydiv').html((j.root[D - 1].Name), (j.root[D - 1].Description));
However only the name is showing when I run it?
Upvotes: 0
Views: 49
Reputation: 780798
.html
does not take multiple arguments. Use +
for concatenation to combine all the strings into a single argument.
$('div#mydiv').html(j.root[D-1].Name + ' ' + j.root[D-1].Description);
Upvotes: 2