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 For Loops

Does not display

Hi,

I can not see my js circles displayed on the screen like on the video.

below is my html code: <!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>

JS:

var html = '';

<div> 1 </div>

for (var i = 1; i <= 10; i +=1) { html += '<div>' + i + '</div>'; } document.write(html);

<!DOCTYPE html>

Circles

JS:

var html = '';

1

for (var i = 1; i <= 10; i += 1) {
     html += '' + i + ''; }

document.write(html);

That's your html code? or your JS code? If anything you're just going to write the numbers 1-10 to the doc. Maybe you could reformat the code in your question using the markdown cheatsheet below the text box?

It's hard to see what's going on.

3 Answers

Alisa Trunczik
Alisa Trunczik
3,659 Points

Try to delete "js/" here in html:

<script src="js/script.js"></script>

Worked for me=)

That worked. Thanks

Ben Berning
Ben Berning
31,784 Points

I had the same problem. Either remove the "js/" from the html or move the script.js file into the js folder.