I use the following to find a string in a specific element, if it exists, check the box. This works fine in Firefox, but not in Internet Explorer (8). It’s hard for me to find a reason.
$.fn.searchString = function(str) {
return this.filter('*:contains("' + str + '")');
};
var myID = $('div').searchString(files_array[i].substr(-4));
alert(myID);
alert(myID.children());
myID.children().attr('checked', true);
alert(myID.children().attr('checked'));
Do IE like the children () function?
Thank you all for your help.
source
share