John Resig jQuery jQuery is designed for protyping. Can layer functionality onto the page using CSS (classes, etc.) also makes it easy to seperate behavior. Basic jQuery: find element and perform action $("div").addClass("special"); * $: jQuery Object (also "jQuery" for namespace) * "div": string to find some element (CSS expression) * addClass: command * "special": name of class Element selection via full CSS 1, 2, 3 selector support, which is better than most browsers. Does NOT rely on browser selector, so good across browsers, etc. Can also do enhanced features. * Child selectors, "div > div": only divs that are a children of div * Has, "div:has(div)": divs that have a div inside of them * attribute, "a[target]": all a's that have a target attribute * attribute, "a[target-_blank]": all a's that have a target attribute set to blank If an element doesn't match on the page, it's silently ignored. This matches CSS behavior in good ways (forgiving) and bad ways (can make it hard t debug). Things to do with elements. DOM manipulation (append, prepend, remove), events, effects (hide, show, slide, etc.), AJAX (get, load, etc.). These are the methods of the object. DOM: ".append", ".css". Events: .submit (arg: function that's executed when submit is fired), .click (likewise, return value tells browser whether this should chain (true) or stop (false), which lets you use unobtrusive Javascript), Animation: .slideDown, .animate (accepts CSS and animates changes), .hide (takes a callback). Inside callbacks, $(this) is the individual element inside the callback (since selectors can get many results). AJAX: .load (smart enough to load external HTML once no matter how many places it gets written). .load allows use of selectors inline, which are applied to the incoming document. E.g. $("#body").load("sample.html div > h1") will only grab the