To get what you want pretty quickly (the closest parent tr to each checked box), you could do something like this:
$.fn.extend({ closestByTagName: function(tagname) { var tag = tagname.toUpperCase(), i = this.length, node, found=[], trParents; while(i--) { node = this[i]; while((node=node.parentNode) && node.nodeName != tag); if(node) { found[found.length] = node; } } return $(found); } }); var result = $('input:checked').closestByTagName('tr');
This is ugly, but I canβt come up with a faster way. (it should far surpass jQuery)
source share