Dissecting jQuery – Filters


Sporadically, over the course of each month, we’ll post a “Dissecting jQuery” video quick tip. The idea behind these is that we’ll take a single chunk of the jQuery source at a time, break it down, and determine exactly what’s going on under the hood, so to speak. Then, with that knowledge, we’ll learn how to better utilize the library in our coding. Today, we’ll review filters.

Also available in this series:

  1. Dissecting jQuery – Filters
  2. Dissecting jQuery – The Text Method

jQuery’s Source for the :hidden Filter

The :visible Filter

Quite cleverly, the :visible filter only needs to call the hidden method, and return the reciprocal.

Full Screencast

);"> jQuery source code to view a listing of other helpful filters that are available to you.

Harnessing this Knowledge to Extend jQuery

Note: jQuery.expr[':'] is simply an alias for jQuery.expr.filters.

Stay tuned. In future episodes, we’ll continue to slice out more chunks of the jQuery source, and dissect them!