I'm trying to get this code to toggle between innerhtml - turn off embedded music. But it doesn't seem to be firing?
The html in question:
<span id="music">
<embed src="http://thewalshgroup.ca/dev/the-nest/music/12_full_prom-night_0132.mp3"autostart="true" loop="true"
width="2" height="0" id="player"> <noembed> <bgsound src="http://thewalshgroup.ca/dev/the-nest/music/12_full_prom-night_0132.mp3"> </noembed>
</embed>
</span>
and the jquery function:
$(document).ready(function() {
var playing = true;
$('#music_control').click(function() {
if (playing == false) {
alert('false');
$('music').html("<embed src='http://site.com/dev/link/music/12_full_prom-night_0132.mp3'autostart='true' loop='true'
width='2' height='0' id='player'> <noembed> <bgsound src='http://site.com/dev/link/music/12_full_prom-night_0132.mp3'> </noembed>");
playing = true;
$("#music_control").text("MUSIC ON");
} else if (playing == true) {
alert('true');
$('music').html("<embed src='http://site.com/dev/link/music/12_full_prom-night_0132.mp3'autostart='false' loop='true'
width='2' height='0' id='player'> <noembed> <bgsound src='http://site.com/dev/link/music/12_full_prom-night_0132.mp3'> </noembed>");
playing = false;
$("#music_control").text("MUSIC OFF");
}
});
});