Before you start studying jQuery, you should have a basic knowledge of: HTML CSS JavaScript
Query is a JavaScript Library.
jQuery greatly simplifies JavaScript programming. jQuery is easy to learn. jQuery is a lightweight, "write less, do more", JavaScript library. The purpose of jQuery is to make it much easier to use JavaScript on your website. jQuery takes a lot of common tasks that require many lines of JavaScript code to accomplish, and wraps them into methods that you can call with a single line of code. jQuery also simplifies a lot of the complicated things from JavaScript, like AJAX calls and DOM manipulation. The jQuery library contains the following features: HTML/DOM manipulation CSS manipulation HTML event methods Effects and animations AJAX Utilities The jQuery library is a single JavaScript file, and you reference it with the HTML <script> tag (notice that the <script> tag should be inside the <head> section): <head> <script src="jquery-1.12.0.min.js"></script> </head> With jQuery you select (query) HTML elements and perform "actions" on them.
jQuery Syntax
The jQuery syntax is tailor made for selecting HTML elements and performing some action on the element(s). Basic syntax is: $(selector).action() A $ sign to define/access jQuery A (selector) to "query (or find)" HTML elements A jQuery action() to be performed on the element(s) $(document).ready(function(){ // jQuery methods go here... }); This is to prevent any jQuery code from running before the document is finished loading (is ready).
jQuery Selectors
jQuery selectors allow you to select and manipulate HTML element(s) All selectors in jQuery start with the dollar sign and parentheses: $(). The element Selector The jQuery element selector selects elements based on the element name. You can select all

elements on a page like this: $("p")

The #id Selector
The jQuery #id selector uses the id attribute of an HTML tag to find the specific element. An id should be unique within a page, so you should use the #id selector when you want to find a single, unique element. $("#test")
The .class Selector
The jQuery class selector finds elements with a specific class. To find elements with a specific class, write a period character, followed by the name of the class: $(".test" Example $(document).ready(function(){ $("button").click(function(){ $(".test").hide(); }); })




up