Recursive .children(a, b) instead of .children(a).children(b)
I would like to suggest extending the functionality of a .children method (and other traversing methods where applicable) to accept variable length parameters set.
Currently I use my own extension method which does the job:
- jQuery.fn.extend(
- {
- childrenCascade: function()
- {
- var result = this;
- for (var i = 0; i < arguments.length; i++)
- {
- result = result.children(arguments[i]);
- }
- return result;
- }
- }
It would be nice to have such an option using pure jquery. Simple to implement, handy and intuitive (at least I hope so :-) ). Unless there is a nicer way to do that... ?