Sunday 18 September 2016

JQuery part I

Introduction
JQuery is a JavaScript library, written in JavaScript, to simplify the JavaScript programming. JQuery completes a task in much less lines of codes than JavaScript to complete the same task.
  
Including JQuery in JavaScript
JQuery can be included in the JavaScript code either by downloading the library or by Content Delivery Network (CDN). CDN is provided by Google and Microsoft.

Advantage of including via a CDN
When a user requests a file from CDN, it is served from the closest server to the user, making it faster to load.

Basic Syntax
Basic syntax is: $(selector).action()
  • $ sign indicated its a JQuery.
  • selector indicates on which element to work.
  • action indicates what action needs to be performed over the element.
some examples are shown below:
$("p").hide() - hides all <p> elements.
$(".test").hide() - hides all elements with class="test".
$("#test").hide() - hides the element with id="test".
$(this).hide() - hides the current element.

Keep Learning, Keep Sharing..~~!!
Ta-Ta

Ref.: w3school.com/jquery