My code goes something like this:
<div class="pBody">
<audio id="player" name="player" class="player" src="" controls="controls"></audio>
</div>
$(document).ready(function(){
$('.fileTr').click(function() {
var id=this.id;
$('#player').attr("src","../mmc/FileSet/" + id);
var sr = $('#player').attr("src");
alert(sr);
$("#player")[0].play();
});
});
fileTr is a class of table columns each having the file name as its id.
What I am trying to do is, when a person clicks a particular column then the id is passed to the function which sets the 'src' attribute for the audio tag and generates a play event. But its not working!
Thanks!