I would like to create a DOM node, set the \'id\' attribute and then append it to \'body\'. The following seems not to work because jQuery doesn\'t see my template as an obj
And here is the one liner:
$("bla").find("li").attr("id","1234").end().appendTo("body")
But I'm wondering why you would like to add the "id" attribute at a later stage rather than injecting it directly in the template.