'contentWindow' Example : Iframe « HTML « JavaScript DHTML






'contentWindow' Example

 
    
<html>
<body>
<script language="JavaScript">
    function myLocation() {
        alert(document.all.myFrame.contentWindow.location);
    }
</script>
<iframe id="myFrame" src="http://www.java2s.com" style="width:200;">
</iframe>
<br>
<button onclick="myLocation();">Location of Frame</button>
</body>
</html>

    
      
        
  








Related examples in the same category

1.'allowTransparency' Example
2.Update two iframes
3.IFrame operation
4.Reload iframe to another url