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 Loops, Arrays and Objects Simplify Repetitive Tasks with Loops A Closer Look at Loop Conditions

Corey Standish
Corey Standish
14,835 Points

Bold Variables

How do you make the attempts variable in the document.write show as Bold type?

Corey Standish
Corey Standish
14,835 Points

i want the number of attempts the computer made to show up as bold in the document.write output .

Did you try

document.write(variable.bold());
Corey Standish
Corey Standish
14,835 Points

document.write("<p>It took the computer " + attempts.bold() + " attempts to get it right.</p>");

this did not work

hmmm, try wrapping attempts in b tag like so

document.write("It took the computer <b> " + attempts + "</b> attempts to get it right.");

2 Answers

Not sure exactly what you mean but try

document.write(variable.bold());

Not sure if this will work either

No problem :)

document.write("<p>It took the computer <strong>" + attempts + "</strong> attempts to get it right.</p>");