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 jQuery Basics Working with jQuery Collections jQuery-Specific Selectors

Stefan Cutajar
Stefan Cutajar
7,747 Points

Benefit of using jquery instead of css

Hi, Is there any particular reason why you use jQuery to select elements instead of normal css?

2 Answers

Steven Parker
Steven Parker
231,261 Points

Normally, these are used for different things. CSS is used to apply styling, and JavaScript/jQuery to add functionality.

Where there is overlap, such as animations, CSS often has the advantage of smoother rendering in the browser.

Boon Kiat Seah
Boon Kiat Seah
66,664 Points

Its for the benefit of teach jQuery. Otherwise, this should be done in css where concerns are separated for good coding practice.