is tedious doing it in object format when text editors will help autofill tags to help you generate strings. Also with a lot of tags to add you would be calling a lot of unnecessary functions
Seems a lot easier to handle in this format:
var html='<a href="#" id="link1">test1</a>';
html+='<a href="#" id="link2">test2</a>';
$('body').append(html);
$('a:first').click(function(){....});