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

CSS jQuery Basics (2014) Introduction to jQuery Ways to Include jQuery in a Project

why include jquery in the html file?

in the first video we have not included jquer in the html file just included the jquery code in the jss file. with succes.

now we include the jquery library and we complicated the code in the jss file.

why?

2 Answers

You can write j query code in the html file, but most of the time people avid doing that. Keeping code on separate files keep thing much more cleaner and flexible.

First: What is a jss file?

Second: jQuery is a very useful JS library which is used mainly for DOM manipulation. I recommend using it.

You should never embed the jQuery library into an HTML page. Instead, use the script tag to "import" the script into the page.