$.subordinate()
is a combination of $.append()
and $.find()
.
It appends an element but returns this new created jQuery object. That makes your code way much shorter and cleaner, when building complex DOM structures on-the-fly.
$('body')
.subordinate( '<div id="parent"></div>' )
.subordinate( '<h1>Headline</h1>' );
$('body')
.subordinate( 'div#parent' )
.subordinate( 'h1', "Another headline" );
$('body').subordinate( 'div#parent > p.child > span', "I like!" );