I'm trying to populate a HTML5 player in a modal via jquery. The goal is to play one of two mp3s based on whether you were invited to the website, or registered on your own. I have a hidden field that stores the src path and I want my jquery function to load the audio file based on that src. On page load, the audio file isn't loading into the player. Not sure what I'm missing, any help would be appreciated.
HTML
<asp:HiddenField ID="hidModalMsg" runat="server" />
/*Unrelated code*/
<div class="audio" runat="server">
<audio id="modalPlayer" onload="('#modalPlayer').src='';" controls="controls">
<p>Your browser does not support the audio element.</p>
</audio>
</div>
Jquery in header
$(function () {
var audPlayer = $('#modalPlayer');
audPlayer.src = $('#<%= hidModalMsg.ClientID%>').val();
});