鍍金池/ 問答/HTML/ 請教下如何在一個iframe中獲取兄弟iframe的name值

請教下如何在一個iframe中獲取兄弟iframe的name值

圖片描述

如圖,請教下如何在sidebar的iframe內部寫代碼獲取到id為main的iframe的name值(屬性值)

回答
編輯回答
陪我終

在sidebar的iframe內部

window.parent.document.getElementById('main')
2017年6月3日 00:33