Start a free Courses trial
to watch this video
jQuery is a JavaScript framework that makes it simple to add behavior to websites cross-browser using the same CSS selectors web developers are familiar with. This allows you to write less and do more.
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up[treehouse presents] 0:00 [Writing Code in jQuery with Andrew Chalkley] 0:02 Hi, I'm Andrew. 0:05 In this treehouse quick tip, we're talking about jQuery and learning JavaScript. 0:07 jQuery, a framework written in JavaScript, 0:11 offers a simple way to add behavior to website's cross-browser 0:14 using the same CSS selectors 0:18 web developers are familiar with. 0:20 In other words, you can write less and do more. 0:22 To get started with jQuery, visit jquery.com. 0:27 And straight off the bat, 0:30 you can see what jQuery code looks like. 0:32 If we right-click and inspect the code of the site, 0:34 we can see the paragraph with the class neat, 0:37 and it's hidden with display none. 0:39 Let's see what happens when we hit run code. 0:48 As you can see, the paragraph has "ohmy" 0:55 added to its class attribute, 0:58 and the paragraph is shown. 1:00 The $["p.neat"] is jQuery selecting the element 1:02 you want to manipulate and add behavior to. 1:10 The add class method adds the class name 1:12 you want to pass in as an argument. 1:15 So in this case, "ohmy" is added. 1:17 Now neat is still there, too. 1:20 And the show method with the speed of slow 1:22 is passed in to show the hidden paragraph. 1:26 Notice that the methods are chained together, 1:30 resulting in less lines of code. 1:33 What you can do in a line of jQuery often amounts to the lines and lines of JavaScript. 1:35 While jQuery weighs in around 30k, 1:41 it's worth the price of an extra download 1:44 instead of reinventing the wheel, 1:46 implementing your own cross-browser framework. 1:48 With over 80% of sites using jQuery, 1:52 it's become the go-to framework when 1:54 adding behavior and interactivity to websites. 1:56 So what are you waiting for? 1:58 Go download it now and try adding it to your next project. 2:00
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up