Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find and remove IFrame

Tags:

html

jquery

A Iframe is dynamically add just after BODY tag and it breaks my all site, So i want to find IFrame which is just after BODY tag and remove it using JQuery. It also adds some Js so, i want also to remove this. Please help me.

HTML Markup

<body>
<iframe></iframe>
<script type="text/javascript">
//<![CDATA[
(function(){
var c = document.body.className;
c = c.replace(/no-js/, 'js');
document.body.className = c;
})();
//]]>
</script>
like image 741
Soarabh Avatar asked Feb 17 '26 06:02

Soarabh


1 Answers

var el = document.getElementsByTagName("iframe")[0];
el.parentNode.removeChild(el);
​

or if the #id is static

$("#conash3D0").remove();
like image 153
25 revs, 4 users 83% Avatar answered Feb 19 '26 18:02

25 revs, 4 users 83%