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 trialCorey Standish
14,835 PointsBold Variables
How do you make the attempts variable in the document.write show as Bold type?
Colton Ehrman
Courses Plus Student 5,859 PointsDid you try
document.write(variable.bold());
Corey Standish
14,835 Pointsdocument.write("<p>It took the computer " + attempts.bold() + " attempts to get it right.</p>");
this did not work
Colton Ehrman
Courses Plus Student 5,859 Pointshmmm, try wrapping attempts in b tag like so
document.write("It took the computer <b> " + attempts + "</b> attempts to get it right.");
2 Answers
Colton Ehrman
Courses Plus Student 5,859 PointsNot sure exactly what you mean but try
document.write(variable.bold());
Not sure if this will work either
Corey Standish
14,835 PointsThat did it. Thanks.
Colton Ehrman
Courses Plus Student 5,859 PointsNo problem :)
Iain Simmons
Treehouse Moderator 32,305 Pointsdocument.write("<p>It took the computer <strong>" + attempts + "</strong> attempts to get it right.</p>");
Corey Standish
14,835 PointsCorey Standish
14,835 Pointsi want the number of attempts the computer made to show up as bold in the document.write output .