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

Triggering an event programmatically

This recipe demonstrates the use of the .trigger() method to invoke events programmatically. The constructs used in this example are as follows:

Construct

Type

Description

$(".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.

.attr("name") or

.attr("name", "value")

jQuery method

This returns a string with the required attribute value of the first matched element. It can also be used to set the attribute to the required value.

[attribute= "value"]

jQuery selector

This selects an element with the specified ...

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