Description:
The contents( ) method finds all the child nodes inside the matched elements (including text nodes), or the content document, if the element is an iframe.Syntax:
Here is the simple syntax to use this method:selector.contents( ) |
Parameters:
Here is the description of all the parameters used by this method:- NA
Example:
Consider you have a blank html file index-blank.htm which we would use in an iframe.Try the following example which shows how you can access the objects in an iframe from a parent window. This operation has become possible just because of contents() method.
<html>
<head>
<title>the title</title>
<script type="text/javascript"
src="/jquery/jquery-1.3.2.min.js"></script>
<script>
$(document).ready(function(){
var $content = $("iframe").contents();
$content.find("body").append("I'm in an iframe!");
});
</script>
</head>
<body>
<iframe src="/jquery/index-blank.htm" width="300" height="100">
</iframe>
</body>
</html>





![jQuery - unbind( [type], [fn] ) Method jQuery - unbind( [type], [fn] ) Method](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3D1qokr9vvAl30ch5jCwh7uv0pD-iBNyRvRw8sUlAc9n4jFJgWAkB4By1x7O93HrcYOR3snmoWhxAL1peRQUm1BBz9Eez86ayKWzf1jXYoKTiFmlwVRzQF4a_RFHr5kdbPGA3quto7Xo/s72-c/images.jpeg)
No comments: