Click here to Skip to main content
13,445,944 members (39,253 online)
Rate this:
Please Sign up or sign in to vote.
I'm trying to access audio tag from iframe and my code doesn't work!!!

is it right or not???

<audio id="player" src="" controls="controls"></audio>
<iframe src="" id="h2.html" width="700" height="800"></iframe>

<script type="text/javascript">
function show(id) {
    var player=window.parent.document.getElementById('player');
<a href="java<!-- no -->script: show('1/Videon.mp3')">song1</a>
<a href="java<!-- no -->script: show('1/Somewhere.mp3')">song2</a>
Posted 3-Jan-13 18:01pm
Updated 3-Jan-13 18:16pm
Sandeep Mewara 4-Jan-13 0:17am
Audio tag from iframe or before iframe? Please clarify.
davemas 4-Jan-13 7:36am
audio tag in the top and then iframe
davemas 4-Jan-13 8:04am
this code only works online is there any code to make access parent window or to access element in another page offline????????

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01-2016 | 2.8.180314.2 | Last Updated 4 Jan 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100