Following the idea of load a page inside a div, as discussed in this post, I would like to retrieve information about a DOM element from this page that I just loaded.
If I run the code below located in test.php, I will be able to see a W3C page, loaded inside a div inside test.php page. Than I will have an alert "Undefined" if I try to retrieve information contained inside the Check "btn". I think it is because the element that I am looking for is not part of the test.php DOM.
So, how can I retrieve information from this element?
This is the 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>