Insert content into iFrame - Javascript jQuery

Javascript examples for jQuery:iframe

Description

Insert content into iFrame

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script> 
      <script type="text/javascript">
    $(function(){/*from  w ww  . j av  a2 s .  c  om*/
var doc = document.getElementById('iframe').contentWindow.document;
doc.open();
doc.write('Test');
doc.close();
    });

      </script> 
   </head> 
   <body> 
      <iframe id="iframe"></iframe>  
   </body>
</html>

Related Tutorials