我有页面内页,我想从内页获取div,内页通过jquery选择器有iframe。 iframe里面没有iframe

时间:2017-08-09 10:38:33

标签: javascript jquery jquery-ui jquery-plugins

我想从div获取任何具有id包装器的数据。 我很震惊,需要你正确的答案。 here is more complete detail of my problem 我如何通过使用jQuery选择器从该div获取数据。

function savehtml(){
  var iframe=$("#gjs-cv-canvas").contents().find("iframe").contents().find("#wrapper").html();
  alert(iframe);
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<html>
            <head>
            </head>
            <body >
            <button onclick="savehtml()">save</button>
            <div id="gjs">
            <div class="gjs-editor">
            <div id="gjs-cv-canvas">
             <iframe class="gjs-frame">
                 <html>
                <head>
                </head>
                <body class="gjs-dashed">
                <div id="wrapper">
              
                 <div>abc</div>
                 <div>abc</div>
                 
                 </div>
                 </body>
                 </html>
             </iframe>
            </div>
            </div>
            </div>
            </body>
            </html>

0 个答案:

没有答案