[英]How to append html inside iframe form element
如果我的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>
如何將內容附加到表單元素?
您可以使用.contents()訪問iframe:
$('#iframesitefileupload').contents().find('#form1')
.append('<div>Hello iframe</div>');
IframeTest.aspx
生成iframe內容,為什么不在那里做呢?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.