I have the following jQuery code which works, but it made me ponder if it were possible to do an append action on what was being appended without the need of specifying what
You can use .appendTo() to append the first .append():
$('',{
'id' : 'child'
}).appendTo('#container').append(
$('', {
'class' : 'close',
'href' : 'javascript:;',
html : 'close',
click : function(e){
e.preventDefault();
$('#' + child).remove();
}
})
);