title: How to remove iframe when click to button
body: <p>I have a script  , if you put it in your website , it will insert iframe to your website 
  the iframe calls a quiz webpage   this quiz page will be above your website, and cover it all if you answer the quiz correctly the quiz page should be removed .. so i do all things , but i can't remove the iframe when he finished the questions in order to see the original website .  </p>
  
  <p>This is a sample of what i want .</p>
  
  <p>I have two pages , the first is the parent  and the second is the child 
  I want to know how to remove an iframe when i click on a button that is inside the child page ;</p>
  
  <p>Parent</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCtype&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt;
    Parent
    &lt;iframe id="frame" src="child.html"&gt;&lt;/iframe&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>And the child </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
    &lt;button onclick="myFunction()"&gt;Click me&lt;/button&gt;
    &lt;script&gt;
      window.onload = function() {
        function myFunction() {
          var getframe = document.getElementById("frame");
          getframe.innerHTML = '';
        }
      }
    &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I get this error </p>
  
  <blockquote>
    <p>myFunction is not defined </p>
  </blockquote>
  
  <p>I tried many ways but no one works</p>