Referencing the current jQuery object in a chain?
- by Lance McNearney
At DevDays in SF last year (before jQuery 1.4 was released), I thought they mentioned an upcoming feature in 1.4 that would allow you to reference the current jQuery object while in a chain. I've read through all of the 1.4 improvements and wasn't able to find it. Does anyone know how this can be done?
Example
Being able to access the current jQuery object would be helpful when working with methods that are in relation to the current object like .next():
// Current way
var items = $(this).closest('tr');
items = items.add(items.next(':not([id])'));
// Magical 1.4 way? Is there a "chain"-like object?
var items = $(this).closest('tr')
.add(chain.next(':not([id])'));