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 trial

JavaScript JavaScript Basics (Retired) Working With Numbers Doing Math

How do I change the font in scripts.js? I've tried document.write(message.fontSize(24)); didn't work.

I've also tried to create a new variable so that the message would go in there, so it would look like: var ageInSeconds = 'You\'ve lived ' + secondsLived + ' seconds.'; var firstMessage = ageInSeconds.fontSize(24); document.write(firstMessage);

Which did not work....

3 Answers

Clayton Perszyk
MOD
Clayton Perszyk
Treehouse Moderator 48,850 Points

Hey Valorie,

ageInSeconds.fontSize(24) should be ageInSeconds.fontsize(24).

fontsize is all lowercase

But according to MDB object.fontsize() is deprecated so it won't be in use at all for too much longer. You can still use it for now. I also believe there is an easier way to make this code work: var secondsLived = age * secondsInDay * daysInYear; var firstMessage = "You've lived " + secondsLived + " seconds."; document.write(firstMessage.fontsize(7)); (you can larger font within document.write statement, instead of in a different variable first)

Samantha Atkinson
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Samantha Atkinson
Front End Web Development Techdegree Graduate 40,307 Points

Hi Valerie, Did you mean you wanted the font size larger when it was printed to the browser. If so simply adding <h2> tag would have given you larger text. Example:
document.write('<h2> I\'ve lived for ' + secondsAlive + ' seconds! </h2>');