Your question is not clear enough but only from a guess I think you want to dynamically add a div and also want to register an event for that div, if this is the case then you may do it like this way too, but there are other ways as well.
$("#id").after($("<div/>", {
'id':'test',
'click':function() { alert ("Clicked!"); }
}));
DEMO.
Another approach to do this (Keep the event handler registered like this using #test)
$(document).on("click", "#test", function(){
alert ("Clicked!");
});
Insert the new div
$("#id").after($("<div/>", { 'id':'test'}));
DEMO.
Also, if you want to dynamically create/insert a new div and want to trigger the click event on this new div just right after you insert it, then you may try this
$(function(){
$(document).on("click","#test", function(){
alert ("Clicked!");
});
// insert a new div with id 'test' and invoke click event immediately
var div = $("<div/>", { 'id':'test'});
$("#id").after(div);
div.trigger('click');
});
DEMO.
.after("<div></div>")should be creating the empty div element, no need to "trigger" anything.