What is jQuery?

jQuery is a JavaScript library that focuses on simplifying DOM manipulation, AJAX calls and visual effects. jQuery was initially developed in 2006 to make JavaScript coding easier of browser inconsistencies.

For example a couple of years back when adding an event listener to an element it was required to use two statements to accomplish cross-browser compatibility, like so:

//ie6
document.body.attachEvent("click", function () {
   //...do stuff
})

//other, "normal" browsers
document.body.addEventListener("click", function () {
    //...do stuff
})

jQuery simplified those statements by allowing a method .click() to be used, like so:

$(document.body).click(function () {
    //...do stuff
})

Resources

Related

Leave a comment

Your email address will not be published. Required fields are marked *