Currently selectors are only subtractive on the matched set
Would it be possible/good to allow selectors to add to the matched set as well?
the custom selector callback
$.extend($.expr[':'], {
mySelector: function (o, index, match, set) { ... }
});
you could add items from here?
some suggestions
1. add a new parameter 'addItems', to which we can append the new items
2. push new items onto set
3. in this context this is the window, could it be the jQuery calling the selector
The reason I want to do this is, I want to be able to select items up the DOM, so that I can target the column of cells for a matched cell, and I would like to be able to do this with selectors only
$("td").click(function(){ $(this).filter(":col").addClass("highlight"); });
Many thanks