Introducing JQuery Library


Hi people! This is the lesson one of this course. Jquery is most popular library of the java script on the planet. This is must that you have some basic knowledge of Java script before learn Jquery, if you have than it's good let started basics of jquery. To use Jquery there is couple of option let take a look on way 1.
Way 1 : Download latest version of Jquery on your local machine on this link JQuery.

Note : There are two options available for download jquery. One is production it is compresses version of jquery and second id development which is uncompressed version with comments and line space and this version of jquery is easily readable so you can decide whatever you want to use. In my opinion you use development version while you are a fresher and learning jquery.

Way 2: You can use live Jquery link for giving jquery reference by using goggle cdn but it is necessary while you using live jquery reference your Internet connection is turn on your local machine. Copy the link and paste it on your script as JQuery script.

Attach JQuery

Attach jQuery

Use Css selectors by Using jQuery.

Image

In the above example first we create a unordered list name Hello World! Than we implied jQuery locally. We use $ sign for display that we using jQuery here and select ('ul li'). This is the way to use css selector behalf of document.getElementsByTagName('ul li') in jQuery than we display this selector by console.log method.

Modify Css by jQuery

$('ul li') .css ('color' ,'red') ;

In above method we set red color property into list items, This change is done dynamically by using jQuery. We can also use a new method to do this by using adding css class into elements dynamically. let see.
In below example we create a class red first than we attach it into list elements by using addClass method with jQuery. We can also use removeClass keyword for removing particular class.

Image

Wconcert India © 2015   ·   All Rights Reserved

Free Web Hosting