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 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,368 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.