Skip to Content
HTML5, JavaScript, and jQuery 24-Hour Trainer
book

HTML5, JavaScript, and jQuery 24-Hour Trainer

by Dane Cameron
February 2015
Intermediate to advanced
408 pages
9h 41m
English
Wrox
Content preview from HTML5, JavaScript, and jQuery 24-Hour Trainer

Lesson 17

jQuery Selection

In this lesson, you will start gaining an understanding of jQuery and the way in which it can simplify interaction with the DOM.

jQuery is an open-source library written entirely in JavaScript. Although it is intended to ­simplify interaction with the DOM, it does not do anything that could not be achieved with the DOM API. In fact, it uses the DOM API to perform its operations.

The following are the main reasons why jQuery is used in so many web applications:

  • It provides an intuitive and easy-to-learn API for performing the most ­common tasks in website development. For instance, the selection API you will use in this lesson is based on CSS selectors.
  • It provides genuine cross-browser support and hides some of the quirks that exist in the DOM API implementations of certain browsers (most notably, older versions of IE).
  • It is very easy to write plugins to enhance the capabilities of jQuery, and there are extensive libraries of freely available plugins on the Internet.
  • The jQuery website contains extremely good documentation, and there is a wide ­variety of help available on the Internet if you encounter problems.

jQuery is not the only library designed to assist with DOM interaction, but it has become the de facto standard, and has a higher market share than all its competitors combined. Therefore, if you are going to learn one JavaScript library, it makes sense for it to be jQuery.

Loading jQuery

Before using jQuery, you need to import it into ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Realtime Web Apps: With HTML5 WebSocket, PHP, and jQuery

Realtime Web Apps: With HTML5 WebSocket, PHP, and jQuery

Jason Lengstorf, Phil Leggetter
jQuery in Action, Third Edition

jQuery in Action, Third Edition

Aurelio De Rosa, Yehuda Katz, Bear Bibeault

Publisher Resources

ISBN: 9781119001171Purchase book