Reputation: 327
I have the following code:
<div>text</div>
<input id="audio_file" type="file" accept="audio/*" />
<audio id="audio_player" />
<div>text</div>
However only the div before but not after the audio tag is rendered. How can I fix this?
Upvotes: 1
Views: 545
Reputation: 5210
You need to close your audio correcty with <audio></audio>
because it isn't a self closing tag.
<div>text</div>
<input id="audio_file" type="file" accept="audio/*" />
<audio id="audio_player"></audio>
<div>text</div>
Inside the audio
tag you could insert a source
, track
or append a text conent
.
The text content
would be displayed if the browser dosn't support the audio api.
<!-- from mdn webdocs -->
<audio controls="controls">
Your browser does not support the <code>audio</code> element.
<source src="foo.wav" type="audio/wav">
</audio>
Upvotes: 2