I'm looking for a simple way to insert an MP3 file in the body of an
HTML page. The code below works, but it doesn't validate due to the
embed tag. Is there a way to rewrite the code so that it will validate
as either valid HTML, or better yet, XHTML?
<script>
function EvalSound(sound obj) {
var thissound=docum ent.getElementB yId(soundobj);
thissound.Play( );
}
</script>
<embed src="MY_SOUND.m p3" autostart="Fals e" width="0" height="0"
id="sound1"
enablejavascrip t="true">
<form>
<input type="button" value="Play Sound" onClick="EvalSo und('sound1')">
</form>
HTML page. The code below works, but it doesn't validate due to the
embed tag. Is there a way to rewrite the code so that it will validate
as either valid HTML, or better yet, XHTML?
<script>
function EvalSound(sound obj) {
var thissound=docum ent.getElementB yId(soundobj);
thissound.Play( );
}
</script>
<embed src="MY_SOUND.m p3" autostart="Fals e" width="0" height="0"
id="sound1"
enablejavascrip t="true">
<form>
<input type="button" value="Play Sound" onClick="EvalSo und('sound1')">
</form>
Comment