I have created a div using jquery that i want to make a dialog. I want to append another div in that dialog before opening it. How can i do that??
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You could add a DOM Object into a div with:
$("div#dialog").append("<div></div>");
回答2:
create new div and apend old div to it to old div
var newDiv = $(document.createElement('div')); //Note 1
$("#ID_OF_OLD_DIV").appendTo($(newDiv));
$(newDiv).dialog();//or what ever you are using
Nte 1: from this answer