Instant JQuery Selectors

Book description

Learn how to master the art of effectively using jQuery’s selectors

  • Learn something new in an Instant! A short, fast, focused guide delivering immediate results
  • Create your own jQuery filters to retrieve elements using a mnemonic name chosen by you
  • Learn how to improve performances by just tweaking selectors
  • Combine multiple selectors to express complex criteria
  • Filter a collection of elements using the myriad of filters available in jQuery

In Detail

jQuery's selectors is one of the most important concepts of the jQuery library. Usually, the first thing you do is to select one or more elements of a page in order to manipulate them. Therefore, to efficiently learn the usage of jQuery's selectors is one of the first steps to successfully build your website.

Instant jQuery Selectors is a practical guide that will teach you how to use jQuery's selectors efficiently in order to easily select theelements of your pages to operate upon with jQuery's methods. You will go through the most common problems that you could face while developing your project and will learn how to solve them with the help of focused examples that Instant jQuery Selectors has to offer.

Instant jQuery Selectors, starting from how to set up jQuery and how to choose the right version for your project, explains to you all the selectors available using a multitude of simple and practical recipes that will help you start using selectors in the right way. Reading the presented recipes you'll learn about the numerous selectors and filters of jQuery – almost 100 of them! You will see how to reuse collections, the methods to filter collections, and how to take advantage of the lesser known parameter of jQuery's constructor: context. Also, you'll discover the methods to traverse the DOM and the techniques to improve the performance of your website by just tweaking selectors.

Instant jQuery Selectors is the resource to learn everything you need to know about jQuery's selectors.

Table of contents

  1. Instant jQuery Selectors
    1. Instant JQuery Selectors
    2. Credits
    3. About the Author
    4. About the Reviewer
    5. www.PacktPub.com
      1. Support files, eBooks, discount offers and more
        1. Why Subscribe?
        2. Free Access for Packt account holders
    6. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    7. 1. Instant jQuery Selectors
      1. Setting up jQuery (Must know)
        1. Getting ready
        2. How to do it...
        3. There's more...
          1. What version to use?
          2. Compressed or not?
          3. Using a CDN
      2. The All selector (Must know)
        1. How to do it...
        2. How it works...
        3. There's more...
          1. Alternatives to $(document).ready()
          2. Avoiding $(document).ready()
          3. css() and browsers support
          4. Selectors and browsers support
          5. Performance
      3. Selecting by ID (Must know)
        1. How to do it...
        2. How it works...
        3. There's more...
          1. Escaping special characters
          2. Storing a collection
      4. Selecting by class (Must know)
        1. How to do it...
        2. How it works...
        3. There's more...
        4. getElementsByClassName()
          1. Selecting elements having two or more classes
      5. Selecting by tag (Must know)
        1. How to do it...
        2. How it works...
        3. There's more...
          1. Selecting and using tag names with classes and IDs
          2. getElementsByTagName()
      6. Multiple selectors at once (Should know)
        1. How to do it...
        2. How it works...
      7. Selecting by hierarchy (Must know)
        1. Getting ready
        2. How to do it...
        3. How it works...
      8. Selecting by attributes (Should know)
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Multiple attribute selector
          2. Not equal selector
          3. Using filter() and attr()
      9. Selecting by position using filters (Should know)
        1. Getting ready
        2. How to do it...
        3. How it works...
      10. Selecting from elements using filters (Should know)
        1. Getting ready
        2. How to do it...
        3. How it works...
      11. Child filters (Should know)
        1. Getting ready
        2. How to do it...
        3. How it works...
      12. Other filters (Become an expert)
        1. Getting ready
        2. How to do it...
        3. How it works...
      13. Custom filters (Become an expert)
        1. How to do it...
        2. How it works...
      14. Context matters (Should know)
        1. How to do it...
        2. How it works...
        3. There's more...
      15. Improving performance re-using selected elements (Become an expert)
        1. How to do it...
        2. How it works...
      16. Methods to filter collections (Become an expert)
        1. Getting ready
        2. How to do it...
        3. How it works...
      17. Traversing DOM SubTrees (Become an expert)
        1. Getting ready
        2. How to do it...
        3. How to do it...
      18. How to have efficient selectors (Become an expert)
        1. How to do it...

Product information

  • Title: Instant JQuery Selectors
  • Author(s): Aurelio De Rosa
  • Release date: August 2013
  • Publisher(s): Packt Publishing
  • ISBN: 9781783282210