搜索資料獲取iframe對象可以這樣寫
document.frames("iframeId").document;
或
window.frames['iframeId'].document
注:注意:window.frames只可寫成window.frames[‘iframeId’]不能寫成window.frames(‘iframeId’)
但是在IE環境下測試會報Uncaught TypeError: document.frames is not a function 這樣的錯
是用下面的寫法解決該問題的:(可以支持在IE10、IE11和google環境下使用)
document.getElementById("iframeId").contentDocument;