Alejandro Rodriguez
Alejandro Rodriguez
3,020 Points

i 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
Emre Karakuz
9,091 Points

Your code is missing apostrophe.

document.write('<h2>' + 'Has vivido' + valor + 'en año' + '</h2>');


document.write('<h2>Has vivido' + valor + 'en año</h2>');
Zoltan Parragi
Zoltan Parragi
6,007 Points

Try 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.