JavaScriptでiframe内の要素を取得する
JavaScriptでiframe内の要素を普通に取得しようとしてもエラーが出る。
まず、.contentWindow.documentで、iframe内の全要素を取得して、そこからは通常と同じように要素を取得する。
code:sample.js
var subdoc = document.getElementById("product-description-iframe").contentWindow.document;
var detail = subdoc.getElementById("productDetailsTable");