You can use the following to create a div on runtime using Jquery with an id for further use.
var divNew = $(document.createElement('div')).attr('id', "div1");
$divNew.appendTo(document.body);
Above line will create a div with id= div1 and second line will append it to the document's end.
and you can use it further by referring to its id i.e. div1 .
Hope it will help. :)