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 trialHannah Blair
8,843 Pointspreview just shows a blank page??? Help?
When I preview the code that I did in workspaces as I followed along all that it shows is a blank page... I think my code is the same as the video, am I missing something? uncaught syntax error?
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Circles</title> <link rel="stylesheet" href="css/styles.css"> </head> <body id="color"> <script src="js/script.js"></script> </body> </html>
var html = '';
for ( var i = 1; i <= 10; i +=1 ) { html += '<div>' + i '</div>; } document.write(html);
1 Answer
Alexander Davison
65,469 PointsYou forgot a plus sign after the i. Also you forgot another ' after the closing div tag. This should fix it:
var html = '';
for ( var i = 1; i <= 10; i +=1 ) {
html += '<div>' + i + '</div>';
}
document.write(html);
Hope this helps and happy coding! ~Alex
Hannah Blair
8,843 PointsHannah Blair
8,843 Pointstysm!!!!!
Alexander Davison
65,469 PointsAlexander Davison
65,469 PointsNo problem!