var test = $('').addClass('test').append(
$('
').addClass('innertest').text('Hello!')
), innerDiv = test.find('.innertest').parent().appendTo('body')
This is manipulating before appending to the body element. Is this what you meant? If not can you please specify?