Selecting a control by its attribute
In this recipe, we will select ASP.NET controls based on a particular attribute they have. The demonstration uses the NavigateUrl
property of ASP.NET Hyperlink controls, which is rendered as an href
attribute of the anchor
tag. The constructs used are summarized as follows:
Construct |
Type |
Description |
---|---|---|
|
jQuery selector |
This selects an element based on its |
|
jQuery selector |
This adds the specified CSS class to each matched element |
|
jQuery selector |
This selects an element with the specified attribute containing the string |
|
jQuery event binder |
This binds a handler to the |
|
jQuery method |
This prevents the default action of the event from being triggered |
|
jQuery event binder |
This triggers the |
|