獲取父視窗iframe方法

2022-02-21 07:28:09 字數 305 閱讀 7189

在頁面中,有個iframe,基於這個iframe,彈出了個視窗,這個視窗在關閉的時候需要操作iframe裡的元素。

做法是

window.top.document.getelementbyid("_view_user_index_").contentwindow.document.getelementbyid("score").value = $("#txt_deductible").val();

這裡的_view_user_index_是iframe的id,score是父視窗中的乙個元素,txt_deductible這個元素是彈出層裡的元素

父視窗操控iframe

iframe id為iframecover,其中有個classname為m ebookmaker cover的div 需要獲取iframe中的乙個div物件進行操作 參考 發現 window.frames iframecover document根本獲取不到物件,正確的方法應該是 所說,使用cont...

父視窗中獲取iframe中的元素

js 在父視窗中獲取iframe中的元素 格式 window.frames iframe的name值 document.getelementbyid iframe中控制項的id click 例項 window.frames ifm document.getelementbyid btnok clic...

iframe 父視窗和子視窗的呼叫方法

父視窗呼叫子視窗 iframe id.iframe document object.object attribute attribute value 例子 onclick iframe text.myh1.innertext 子視窗呼叫父視窗 parent.parent document objec...