O'Reilly logo

ASP.NET jQuery Cookbook - Second Edition by Sonal Aneel Allana

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Refining selection using a filter

jQuery provides a useful .filter()method to filter elements using a selector or custom function. In this recipe, we will filter the rows of a GridView control on the client side using this method. The constructs used in this example are summarized in the following table:

Construct

Type

Description

$(#identifier)

jQuery selector

This selects an element based on its ID

$(".class")

jQuery selector

This matches all elements with the specified CSS class

$("html_tag")

jQuery selector

This selects all elements with the specified HTML tag

$(this)

jQuery object

This refers to the current jQuery object

.click()

jQuery event binder

This binds a handler to the click event of an element

:eq(i) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required