Start a free Courses trial
to watch this video
jQuery, a framework written in JavaScript, offers a simple way to add behavior to websites using the same CSS selectors web developers are familiar with. In other words, you can write less, and do more! Treehouse jQuery teacher Andrew will help you get started with jQuery in this Treehouse Quick Tip.
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[?music?] treehouse presents 0:00 Writing Code in jQuery with Andrew Chalkley 0:00 Hi! 0:05 I'm Andrew. 0:06 In this treehouse quick tip, 0:07 we're talking about jQuery and learning javascript. 0:08 jQuery, a framework written in javascript, 0:11 offers a simple way to add behavior to websites 0:14 cross-browser, 0:16 using the same CSS selectors 0:18 web developers are familiar with. 0:20 In other words, 0:22 you can write less and do more. 0:23 To get started with jQuery, 0:25 visit jquery.com 0:28 and straight off the bat you can see what jQuery code looks like. 0:30 If we right-click and inspect the code of the site, 0:33 we can see the paragraph with the class neat? 0:37 and its 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 added 0:54 to its class attribute, 0:58 and the paragraph is shown. 1:00 The $["p.neat"] is jQuery selecting the element you want to manipulate 1:02 and add behavior to. 1:11 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 The show method with the speed of slow is passed in to show the 1:22 hidden paragraph. 1:28 Notice that the methods are chained together, 1:29 resulting in less lines of code. 1:33 What you can do in a line of jQuery 1:35 often amounts to lines and lines of javascript. 1:38 While jQuery weighs in around 30k, 1:42 it's worth the price of an extra download 1:45 instead of reinventing the wheel, 1:46 implementing your own cross-browser framework. 1:48 With over 80% of sites using jQuery, 1:51 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. 1:59
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