1
$("#<%=ApprovalSelectPanel.ClientID %> input:checkbox:checked").each(function(){

    alert(this.val);

});

This isn't returned the value attribute on each checkbox, it's returning undefined

1

1 Answer 1

5

In this context, this is the DOM object.

Try this instead:

$("#<%=ApprovalSelectPanel.ClientID %> input:checkbox:checked").each(function(){

    alert($(this).val());

});

Although, this work have worked as well:

    alert(this.value);
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! Been trying to figure that out for ages
Or, you can try alert(this.value), if you want to avoid a $ call.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.