我將目標表單提交給iFrame。現在,當我嘗試獲取iFrame的innerHTML時,我得到空值。這裏是我的代碼:獲取iFrame的更新值
<form name="upload_form" action="" method="post" target="upload_target">
//----- other tags
</form>
<iframe id="upload_target" name="upload_target" src=""></iframe>
該操作返回一個id值,它將被設置爲iFrame。之後,當我嘗試獲取iFrame的innerHTML時,它顯示爲空。在UI中,我可以看到iFrame中的id值。
JS代碼:
alert(document.getElementById("upload_target").innerHTML);
我怎樣才能從價值的的iFrame ID?