Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS jQuery Basics (2014) Introduction to jQuery Why jQuery? A Brief History of Front-end Development

Marcio Mello
Marcio Mello
7,861 Points

Comparison of jQuery as the CSS of interactivity

I know this is not something of huge importance to learn jQuery, but I am that type of guy who really needs to understand the "deconstructed model" to understand the whole thing.

In this video Andrew says jQuery is for Javascript what CSS is for HTML styling.

For what I could get, CSS facilitates our work by providing a single file that could affect and change hundreds of .html documents.

But isn't Javscript that also? With the .js file? I could right code inside the .js file and than link it to the .html, providing a way for it to alter the DOM?

I was told that jQuery was just an easier, faster and more concise way of writting JavaScript code.

Is there more to it that I am missing? I Would really love to know.

Thanks in advance!

1 Answer

Julian Aramburu
Julian Aramburu
11,367 Points

jQuery is a JavaScript Library and its target is to reduce the needed lines for a particular JavaScript action into a single line using methods making your code smaller and easier to write. Also jQuery has an unique way to selects elements from the DOM which makes it easier to alter or play with adding or changing CSS styles, effects, movement, attributes or properties. So basically yeah, you could write a long JavaScript app where you change or animate something in your website or you could use jQuery and get it done faster, simpler and easier.

Extracted from w3schools -> The jQuery library contains the following features:

  • HTML/DOM manipulation
  • CSS manipulation
  • HTML event methods
  • Effects and animations
  • AJAX
  • Utilities

Hope you find this answer useful :)

Marcio Mello
Marcio Mello
7,861 Points

Thanks Julian, it is useful.

Julian Aramburu : What is the DOM? I feel like this was another major concept that Andrew didn't cover fully.