Javascript - JQuery

About

Jquery is a javascript library that principally implements higher function of the DOM API in order to manipulate HTML page.

As it offers a plugin framework, it's also a great place to share Javascript knowledge.

All jquery example are in the dom section.

Although browsers have built-in APIs for manipulating the DOM, these interfaces are verbose and cumbersome, likely due to standards bodies’ emphasis on unambiguous designs that can be implemented consistently by vendors and survive future revision. As a result, JavaScript libraries that enable more convenient manipulation are hugely popular. Of these, jQuery, is so successful it is often considered synonymous with JavaScript among novices. These libraries share the concept of a selection: identify a set of elements using simple predicates, then apply a series of operators that mutate the selected elements.

Entry point

The jQuery library exposes its methods and properties via two properties of the window object called:

  • jQuery and
  • $ ($ is a shorter alias for jQuery)
if ("jQuery" in window) {
    console.log("Jquery is a property of Window");
} 
if ("$" in window) {
    console.log("$ is a property of Window");
} 

Operations

List:

Library

Library:

See also: cheerio (Jquery like library for Node)

Variable

To make it clear that a variable contains an instance of the jQuery object, variables are prefixed by a $ character:

var $obj = jQuery('#some__id');

where:

Documentation / Reference

Task Runner