views:

149

answers:

1

how do you access the class attribute of a <asp:Checkbox> in a jQuery selector statement?

for example

<asp:CheckBox runat="server" ID="cbTest" Text="Cb Test" FieldName="1st Test Check Box" class="toggleBox"/>

this:

$(':checkbox').toggleAttr("checked", true, false)

accesses the checkbox and applies a custom function to the checked attribute but if i want to filter based on a certain class how do i access/filter based on that?

+4  A: 
rahul
@mike, make note: this answer is applicable for a lot more than jquery and this specific checkbox example. It's one of the underlying mechanisms for css selectors. Learn these concepts well, you will use them everywhere throughout your work.
brad