I have a bunch of links on a page that I want to be clicked once a checkbox is checked off. Each of these links belong to the CSS class "batchClass".
How do I get these links to click once my checkbox is clicked? So far I have the basics of my JQuery function written, and it's going into the function but I can't get the links to fire.
function checkAll() {
if ($('#checkbox').is(":checked")) {
$('.batchClass').each(function () {
$(this).trigger('click');
});
console.log("Inside the function.");
}
}
Add this function is added to the checkbox in C# code..
CheckBox chkAllAccounts = new CheckBox();
chkAllAccounts.Attributes.Add("onclick", "javascript:checkAll()");
How these links are being built in the C#..
info[idx++] = "<a style=\"text-align:center;\" class=\"batchCheck\" id=\"verifiedLink_" + v.ID + "\" href=\"javascript:verifyStatement('" + v.ID + "', '0');\"><img id=\"verifiedState_" + v.ID + "\" src=\"/images/icons/box_checked.png\"></a>";
Could I just do a call to verifyStatement directly?