I am making a custom HTML5/JQuery Audio Player and I have my audio tags named like name="Song Name"
and I want to use JQuery to grab that name tag value and write it in a <p></p>
tag. But whenever it runs it just says [object Object]
instead of the name value.
HTML
<p id="song-name"></p>
<audio name="Song 1" src="/song1.mp3" type="audio/mpeg">
<audio name="Song 2" src="/song2.mp3" type="audio/mpeg">
<audio name="Song 3" src="/song3.mp3" type="audio/mpeg">
JQuery
var songName = $("audio[name]")
$("#song-name").text(songName);
Aucun commentaire:
Enregistrer un commentaire