jQuery is pretty much a big selector transversing engine with useful stuff hung on it. With all that power I can't believe there is not a way to jump around a chain. Therefore I'm assuming I am ignorant in the manner of accomplishing this.
I want to be able to fork a chain in order to make a modification, and then return to the root chain.
Example:
$('#clone-container')
.clone()
.find('#clone-topic') // fork
.attr('id', 'new-topic')
// return to root chain (how?)
.find('#clone-body') // fork
.attr('id', 'new-body')
.attr('id', 'new-container') // return to root chain (how?)
.append('body');
I hope that made at least a little bit of sense. :)
Any help would be appreciated.
Thanks.