Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAlejandro Rodriguez
3,020 Pointsi never can use H1, H2.... what im doing wrong? document.write (<h2> 'Has vivido' + valor + 'en año' </h2>);
Wahts is wrong???
document.write (<h2>' y has vivido ' + horasvividas + ' horas'</h2>);
2 Answers
Emre Karakuz
9,162 PointsYour code is missing apostrophe.
document.write('<h2>' + 'Has vivido' + valor + 'en año' + '</h2>');
or
document.write('<h2>Has vivido' + valor + 'en año</h2>');
Zoltan Parragi
6,007 PointsTry this:
var horasvividas = "something"; document.write ('<h2> y has vivido ' + horasvividas + ' horas </h2>');
Be careful with the quote marks. <h2> and </h2> must be within them.