@kadin
To get the id of an element within an iframe, you can use the following steps:
1
|
var iframe = document.getElementById('iframeId'); |
1
|
var iframeDoc = iframe.contentDocument || iframe.contentWindow.document; |
1 2 |
var elementId = iframeDoc.getElementById('elementId').id; console.log(elementId); |
This will log the id of the element within the iframe to the console.
Please note that the Same Origin Policy applies to iframes, so you can only access the contents of an iframe if it is on the same domain as the parent page.