I have to capture the value of an iframe attribute in pagina.html
, from the parent page pai.html
. I tried everything but I did not succeed.
pai.html :
<iframe id="meuframe" src="//www.site.com.br/fotos/pagina.html"></iframe>
<br></br>
<button onclick="iframejs();">icone</button>
<script>
function iframejs() {
var iframe = window.parent.meuframe.document.getElementById( "video_html" );
alert( iframe.getAttribute( "src" ) );
}
</script>
</body>
</html>
page.html
<!DOCTYPE html>
<html>
...
<video id="video_html5" src="video.mp4" class="video-gs"></video>
...
</body>
</html>