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

Chris Mitchell
3,011 Pointshow do you link your javascript to your html
i wrote my code as <script src="scripts.js"> </script> in the bottom of my body tag. and i saved a new file as scripts.js.
Do i have to make a new folder ?
it shows in my javascript that my code is undefined why is that ?
1 Answer

Steven Parker
242,296 PointsBecause of the way you reference the file in your script
tag, you do not want it in a new folder. It should be in the same place as the HTML file.
To facilitate a complete analysis you can make a snapshot of your workspace and post the link to it here.
Calin Bogdan
14,921 PointsCalin Bogdan
14,921 PointsHello!
Could you please show us the file tree and the file where you reference "scripts.js"? Thanks! That will help a lot.