2011-12-22 104 views
0

里面的html如果我有一个具有以下结构如何添加iframe的表单元素

<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> 

我如何可以追加内容到形式元素的iframe?

回答

2

你可以访问与.contents()一个IFRAME:

$('#iframesitefileupload').contents().find('#form1') 
          .append('<div>Hello iframe</div>'); 
-1

IframeTest.aspx产生iframe中的内容,你为什么不这样做呢?