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

Responding to form events

This recipe demonstrates how to respond to events such as focus and blur that are triggered on controls on the web form. The constructs used in this example are as follows:

Construct

Type

Description

$(this)

jQuery object

This refers to the current jQuery object.

.addClass()

jQuery method

This adds the specified CSS class to each matched element.

[attribute!= "value"]

jQuery selector

This selects elements with the specified attribute that is not equal to the value string.

blur

jQuery event

This is fired when an element loses focus. It corresponds to the JavaScript blur event.

.each()

jQuery method

This iterates over the matched elements and executes a function for each element.

focus

jQuery ...

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