What is JQuery ?

jQuery is an amazing JavaScript library that makes it easy to create wonderful web effects in just a few lines of code

http://docs.jquery.com/Main_Page

How jQuery works?

First you need to download a copy of jQuery and insert it in your html page (preferably within the <head> tag). Then you need to write functions to tell jQuery what to do. The diagram below explains the detail how jQuery work:

How to get the element?

Writing jQuery function is relatively easy (thanks to the wonderful documentation). The key point you have to learn is how to get the exact element that you want to apply the effects.

    * $(“#header”) = get the element with id=”header”
    * $(“h3”) = get all <h3> element
    * $(“div#content .photo”) = get all element with class=”photo” nested in the <div id=”content”>
    * $(“ul li”) = get all <li> element nested in all <ul>
    * $(“ul li:first”) = get only the first <li> element of the <ul>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: