CreateElement in Main Document not in iFrames inside the Document - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:IFrame

Description

CreateElement in Main Document not in iFrames inside the Document

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=( function() {//w  ww. j  a va  2 s  . co m
var elm = document.createElement("p");
elm.innerHTML = "here"
var body = document.body;
body.insertBefore(elm, body.firstChild);
    });

      </script> 
   </head> 
   <body>   
      <iframe></iframe> 
      <iframe></iframe>    
   </body>
</html>

Related Tutorials