Write the Content inside iframe using Javascript

by MariGanesh 2014-06-06 16:25:11

Here is the code for explain how to "Write the Content inside iframe tag using Javascript"
 
<html>
  <head>
    <title>Write the Content inside iframe using Javascript</title>
    <script type='text/javascript'>
    function clickk() {
        var data=document.getElementById("dataa").innerHTML;
       var myiframe = document.getElementById("frameview").contentWindow.document;
myiframe.open();
myiframe.write(data);
myiframe.close(); 
       
    }
    </script>
   
  </head>
  <body>
    <iframe id='frameview'></iframe><br /><br />
<div id='dataa'><b>Hiox.org Scraps</b></div> <br />  
   
    <input type='button' Value='Submit' onclick='clickk()'>
   
    </body>
</html>

Output:



   

Tagged in:

1057
like
0
dislike
0
mail
flag

You must LOGIN to add comments