$(“#dialog”).parent().appendTo($(“form:first”));
问题 I'm opening a few jQuery dialogs on my page and I was using: $("#dialog2").parent().appendTo($("form:first")); //This was working, no problem. I noticed when I applied it again to dialog3 it has stopped that line from working on dialog 2. How can this be used for different dialogs? $("#dialog2").dialog({ bgiframe: false, autoOpen: false, height: 410, width: 800, modal: true, draggable: true, resizable: true }); $("#dialog2").parent().appendTo($("form:first")); //doesn't work now $("#dialog3")