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

Accessing parent and child controls

This recipe demonstrates how to access parent and child elements in the DOM when performing client-side validation of a sample form. The constructs used in this example are summarized as follows:

Construct

Type

Description

$("#identifier")

jQuery selector

This selects an element based on its ID

$("html_tag")

jQuery selector

This selects all elements with the specified HTML tag

$(this)

jQuery object

This refers to the current jQuery object

.addClass()

jQuery method

This adds the specified CSS class to each matched element

:checked

jQuery selector

This selects checked input elements

.children()

jQuery method

This returns the immediate descendant element of the matched elements ...

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