JSFiddle - React, Tailwind, and code Playground
HTML
<p>An MP3 should be playing... click to remove it!</p>
<button onclick="remove_audio()">Remove the audio</button>
JavaScript
id = "12"
soundfile = "http://hpr.dogphilosophy.net/test/mp3.mp3"
$('body').append('<audio id="mother" controls autoplay="autoplay" loop="true" hidden="true" repeat="true"><source id="infrSound' + id + '" src="' + soundfile + '"></audio>');
remove_audio = function() {
console.log($("#infrSound" + id))
$("#mother").remove();
}