Here I construct an array:
var optionTexts = [];
$('#stripeMeSubSubCat tr').each(function(){
if ($(this).find('input:checkbox.subsubcat_chkclass:not(:checked)').length == 0)
{
subsubrow_cat_id_no = parseInt($(this).closest("tr").attr("id"));
optionTexts.push(parseInt(subsubrow_cat_id_no));
};
});
The code below only works whenever the alert is enabled. I have read that this might be due to a synchronization issue. Is there a solution towards the code below? Thank you.
$('#stripeMeSubSubCat tr').each(function(){
myindex = parseInt($.trim($(this).closest("tr").attr("id")));
if (jQuery.inArray(myindex, optionTexts) == -1) {
var equal="FALSE";
}else{
var equal="TRUE";
$("#stripeMeSubSubCat tr[id='" + myindex + "'] input").attr('checked', true);
};
//alert(equal);
});