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.
Here is the simple syntax to use this method −
Here is the description of all the parameters used by this method −
Consider you have an html file index.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.
This will produce following result −