I have a checkboxlist which is being binded from the database and Id of the checkbox is being binded with the help of data-bind attribute and when the user clicks the submit button I'm iterating through the checkboxlist and checking whether the Checkbox is checked on not, if it is checked then i want get the Id of the checkbox.
This is how i tried
if ($(this).is(':checkbox')) {
if (this.checked)
{
var input = $(this);
if ($(input).data().bind) {
alert($(this).data('bind'));
}
}
}
i actually want to get this value data-bind="attr: { value: Id }
But in the alertbox im getting message as data-bind="attr: { value: Id }, where as i want to get 1,2 etc