Javascript 在弹出窗口中加载div内容

Javascript 在弹出窗口中加载div内容,javascript,jquery,html,Javascript,Jquery,Html,我需要在弹出窗口中加载div 目前,我可以通过文档加载其中的直接html内容。编写但如何在弹出窗口中加载div(其中包含表单) 这是当前的代码 function myFunction() { var myWindow = window.open("", "MsgWindow", "width=200, height=100"); myWindow.document.write("<p>Need to load the .content

我需要在弹出窗口中加载div

目前,我可以通过
文档加载其中的直接html内容。编写
但如何在弹出窗口中加载div(其中包含表单)

这是当前的代码

function myFunction() {
            var myWindow = window.open("", "MsgWindow", "width=200, height=100");
            myWindow.document.write("<p>Need to load the .content div here</p>");
        }
函数myFunction(){
var myWindow=window.open(“,”MsgWindow“,”宽度=200,高度=100”);
myWindow.document.write(“需要在此处加载.content div

”; }
Jquery/JavaScript什么都可以


这是我对代码所做的更改:

function myFunction() {
    var myWindow = window.open("", "MsgWindow", "width=200, height=100");

    myWindow.document.write($(".content").html());
    myWindow.document.close();

}

没有?用
替换
,您就有了一个表单。问题是什么?可能的重复必须以
myWindow.document.close()结尾谢谢。。但它并不是采用这种方式。我该怎么做?