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

What is the difference between J Query and JavaScript ?

I am new to Coding and trying to understand what JQuery is and Javascript is ?

2 Answers

JavaScript is the programming language that you use to add interactivity to webpages.

JQuery is a JavaScript library which you can use to simplify your coding - rather than having to create JavaScript applications yourself, you can instead utilise the JQuery library in order to use JavaScript applications that other people have already created.

I'll elaborate - jQuery is more or less an api for the javascript language. The creators of jQuery created an easier, simpler syntax for many common DOM manipulation tasks that developers often do on every project.

Let's say you wanted to select an element.

In pure javascript you'd have something like

document.getElementById('my-selector')

In jQuery, it's just simply

$('#my-selector')

You can see how much more tighter, simpler, and CSS like the same jquery selector is.

All jQuery really does is parse the jQuery back down to pure javascript so the browser can do something with it. It gives us easier to work with functions and selectors.