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

Daniel Grieve
Daniel Grieve
6,432 Points

JS vs CSS

Is this exercise purely for practice or is there an advantage of using JS to style links or any other element as opposed to using CSS?

Steven Parker
Steven Parker
229,967 Points

To which exercise are you referring? Can you provide a link?

1 Answer

CSS describes the layout and appearance of the website when you load it but what if you want to change it for some reason. Like the user clicked on something or a timer went off or or ... JavaScript allows you to CHANGE the way the website looks or is set out and gives you more control after it has been loaded.

Daniel Grieve
Daniel Grieve
6,432 Points

Thanks for the reply. The exercise was to set elements within a list to the colour purple. With no further interaction, I think this was just for practice.