I want to refer iframe which is inside another iframe
<
Use contents() to get inside first frame window once it has loaded:
$('iframe').on('load', function(){
var $secondFrame = $(this).contents().find('iframe');
$secondFrame.attr('src', someUrl)
})
Consider this:
<div class="flex-active-slide">
<iframe class="i1" src=""> <!--But refering this-->
#document
<html>
<body>
<iframe class="i2" src=""><!--want to refer this iframe -->
#document
<html>
<body>
</body>
</html>
</iframe>
</body>
</html>
<iframe>
</div>
You can access iframe with class "i2" as:
var l1 = $(".flex-active-slide .i1")[0];
$(l1.contentDocument).find("iframe.i2");