jQuery For Beginners
Basic syntax is: $(selector).action()
$(this).hide() - hides the current element.
$("p").hide() - hides all elements.
jQuery selectors are one of the most important parts of the jQuery library. jQuery selectors allow you to select and manipulate HTML element(s). jQuery selectors are used to "find" (or select) HTML elements based on their name, id, classes, types, attributes, values of attributes and much more. All selectors in jQuery start with the dollar sign and parentheses: $().
When a user clicks on a button, all elements will be hidden:
As we all know JQuery become much popular over a long period of time but for beginners who have started getting their hands in JQuery, there are some basic things you need to know first:-
- JQuery was released by John Resig in 2006 and is currently being utilized by over 31% of the most popular websites on the internet, thus it has gained popularity.
- The most advantageous thing about JQuery is its open source and not only that it is also dual - licensed under the MIT License and GNU general public license V2. This means any developer can create a JQuery plug-in of their own.
- Last but not the least there are bunches of JQuery plug-ins out there which you may require for any of your task.
The best feature in JQuery is that the team of developers who had developed it had a vast knowledge of cross-browser compatibility and they have fixed most parts of it and they are on with it following with the updates. JQuery runs exactly same on all major and minor browsers, including IE6.
So far we have seen the advantages of JQuery but as we all know everything has a weakness and so does JQuery too. Lets hav a look at it: