Works in Firefox but not IE

Posted by Abs on Stack Overflow See other posts from Stack Overflow or by Abs
Published on 2010-05-27T12:06:21Z Indexed on 2010/05/27 12:11 UTC
Read the original article Hit count: 108

Filed under:
|

Hello all,

I make use of the following to find a string in a particular element, if it exists, tick a checkbox. This works great on Firefox but not internet explorer (8). I am having trouble finding why.

$.fn.searchString = function(str) {
   return this.filter('*:contains("' + str + '")');
};

var myID = $('div').searchString(files_array[i].substr(-4));

alert(myID);//[object object]

alert(myID.children());//[object object]

myID.children().attr('checked', true);//does not tick checkbox

alert(myID.children().attr('checked'));//undefined

Does IE not like the children() function?

Thanks all for any help

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery