var newDiv = $("<div />"); newDiv.attr("id", "myNewDiv").appendTo("body"); /* Now whenever I want to append the new div I created, I can just reference it from the "newDiv" variable */