Pre-loaded iFrame Content - Javascript jQuery

Javascript examples for jQuery:iframe

Description

Pre-loaded iFrame Content

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.6.js"></script> 
      <script type="text/javascript">
    $(function(){/*  www .  ja v  a  2 s  . com*/
var stuff = "<div>test test.</div>";
document.getElementById('iframe').contentDocument.body.innerHTML = stuff;
    });

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

Related Tutorials