Thursday, April 23, 2015

ASP.NET CheckBoxList Operations with jQuery - Check Items By Text

//Check Items by Text
    var selText = ['Item-1','Item-3'];
    var $ctrls = $("[id*=CheckBoxList1]");
    for (var i = 0; i < selText.length; i++) {
        $ctrls.find('label:contains("' + selText[i] + '")').prev().prop('checked', true);
    }

No comments:

Post a Comment