jquery - How to retrieve information about a DOM element from a page loaded inside a div? -


following idea of load page inside div, discussed in post, retrieve information dom element page loaded.

if run code below located in test.php, able see w3c page, loaded inside div inside test.php page. have alert "undefined" if try retrieve information contained inside check "btn". think because element looking not part of test.php dom.

so, how can retrieve information element?

this code: test.php

<!doctype html> <html>     <head>         <meta charset="utf-8">         <title></title>         <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>     </head>     <body>      <div>        <object type="text/html" data="http://validator.w3.org/" width="800px" height="600px" >       </object>      </div>     </body>   </html> <script>     $(document).ready(function(){         alert("ok");         alert($('a[class=submit]').html()); //element inside validator.w3.org not in test.php     }); </script> 


Comments