0

If i have an iframe that has the following structure

<iframe id="iframesitefileupload" src="IframeTest.aspx" style="margin-left:20px" name="iframesitefileupload">
    <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
        <body>
            <form id="form1" action="IframeTest.aspx" method="post" name="form1">

                 //add stuff here ----                      

            </form>
        </body>
    </html>
</iframe>

How can i append contents to the form element?

2 Answers 2

2

You can get access a iframe with .contents():

$('#iframesitefileupload').contents().find('#form1')
                          .append('<div>Hello iframe</div>');
Sign up to request clarification or add additional context in comments.

Comments

-1

IframeTest.aspx generates the iframe content, why don't you do it there?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.