If you're looking to change the inner HTML of an element, there are several methods you can use:
Method 1: Using innerHTML
This method is great for completely replacing the inner HTML content without worrying about existing element references.
document.getElementById('song').innerHTML = '<audio id="audio-player" controls="controls" src="media/Blue Browne.mp3" type="audio/mpeg">';
Method 2: Using appendChild
If you want to maintain a reference to the audio element and other elements within the container, this method is ideal.
var sound = document.createElement('audio');
sound.id = 'audio-player';
sound.controls = 'controls';
sound.src = 'media/Blue Browne.mp3';
sound.type = 'audio/mpeg';
document.getElementById('song').appendChild(sound);
Method 3: Using insertAdjacentHTML
When you need to keep references to existing elements but don't require a direct reference to the audio element at the moment, consider using this method.
document.getElementById('song').insertAdjacentHTML('beforeend', '<audio id="audio-player" controls="controls" src="media/Blue Browne.mp3" type="audio/mpeg">');