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 Foundations Numbers Creating Numbers: Part 2

Placement of Script in CSS vs. JS

Why are I typing code into CSS script as opposed to JavaScript?

Thanks!

D

I think you are confusing

<script>
</script>

with

<style>
</style>

I'm generally confused then! The code test wanted me to add "var = " code into CSS script area of the HTML index... I thought "var" belonged in a .js file or at least the .js <script> area in HTML index.

Thomas Ireland
Thomas Ireland
Courses Plus Student 8,216 Points

I agree with Jeff. Looking at the code challenge, the link to the css file is above the opening <script> tag. As long as your Javascript is between the opening and closing script tags e.g. <script> your code goes here </script>, you will be fine.

1 Answer

yes I think you are definitely confusing script tags with style tags. Watch the video carefully and you will see that there is no such thing as a "CSS script" area.