Puneet_2696717
Puneet_2696717

Reputation: 221

Find div inside an iframe

I have a Page, inherited by a MasterPage. In this page I have two iframes- FrameProcessGrid & FrameProjectQuickView.

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="CenterPanel" class="CenterPanel">
        <iframe id="FrameProcessGrid" runat="server" src="ProjectList.aspx" height="99%" width="99%" style="margin:0px auto;"></iframe>
    </div>
</asp:Content>
<asp:Content ID="ContentRight" ContentPlaceHolderID="ContentPlaceHolderRight" runat="server">
    <div class="RightPanel">
        <iframe id="FrameProjectQuickView" runat="server" src="QuickView.aspx" height="99%" width="99%" style="margin:0px auto;"></iframe>
    </div>
        <div id="HiddenQuickView">
            <input id="ShowQuickViewBtn" type="button" value="<" />
        </div>
</asp:Content>`

Now when I fire a clientclick event from 1st iframe - id=FrameProcessGrid ,it return NULL OR UNDEFINED.

I need to PRINT some TEXT in DIV i.e iframe FrameProjectQuickView . div.innerHTML

How could I do it ?

Upvotes: 0

Views: 566

Answers (3)

Viswanath Donthi
Viswanath Donthi

Reputation: 1821

Try this:

$('#ContentPlaceHolderRight_FrameProjectQuickView').parent().siblings('.FrameProjectQuickView').find('#DivFirstQ‌​VTable').html("PRINT SOME TEXT");

Upvotes: 1

Yunus Aslam
Yunus Aslam

Reputation: 2466

Try this :

$("#FrameProjectQuickView").contents().find("your div id or class").text("You text here");

Hope this helps...

Upvotes: 1

Saksham
Saksham

Reputation: 9380

You can use

$('#iframeID').contents().find('#yourdivID');

Upvotes: 1

Related Questions