title: Remove iframe with javascript
body: <p>I am trying to remove iFrame tags in my documents.
  This is the function. But it don't seem to work. Here is my sample code</p>
  <pre><code>&lt;script&gt;
  function removeiframe() {
              alert(&quot;Hello Lovely World&quot;);
              var markup = document.body.innerHTML;
              
              var filtered=markup.replace(/(&lt;iframe.*?&gt;.*?&lt;\/iframe&gt;)/g,&quot;&quot;);
              alert(&quot;he: &quot; + markup);
  //markup = Regex.Replace(markup, @&quot;&lt;script.*?/script&gt;&quot;, &quot;&quot;, RegexOptions.IgnoreCase);
  //markup = Regex.Replace(markup, @&quot;&lt;iframe.*?/iframe&gt;&quot;, &quot;&quot;, RegexOptions.IgnoreCase);
  markup = filtered;
  document.body.innerHTML = markup + &quot;&lt;hr&gt;&lt;hr&gt;HELLO&quot;;
          }
  &lt;/script&gt;
  &lt;body onload=&quot;removeiframe()&quot;&gt;
      
          &lt;iframe marginheight=&quot;0&quot; src=&quot;http://www.hotelanswer.com&quot; marginwidth=&quot;0&quot; frameborder=&quot;0&quot; height=&quot;180&quot; scrolling=&quot;no&quot; width=&quot;210&quot;&gt;&lt;/iframe&gt;&lt;br&gt;
  &lt;/body&gt;
  </code></pre>