I like the following approach myself:
$('',{
'class' : 'wrapper',
'html': $('
',{
'class' : 'inner',
'html' : $('
').text('Some text')
}).add($('',{
'class' : 'inner',
'html' : $('
').text('Other text')
}))
}).appendTo('body');
Alternatively, create your wrapper first, and keep adding to it:
var $wrapper = $('',{
'class':'wrapper'
}).appendTo('body');
$('
',{
'class':'inner',
'html':$('
').text('Some text')
}).appendTo($wrapper);
$('',{
'class':'inner',
'html':$('
').text('Other text')
}).appendTo($wrapper);