JSFiddle - React, Tailwind, and code Playground
HTML
<div id="app">
</div>
<button id="button">
Toggle Sound
</button>
JavaScript
var birds = "http://www.tutorialrepublic.com/examples/audio/birds.mp3";
var wind = "http://www.tutorialrepublic.com/examples/audio/wind.mp3";
var app = document.getElementById("app");
var button = document.getElementById("button");
var audio = document.createElement("audio");
var source = document.createElement("source");
audio.controls = "controls";
source.src = birds;
audio.appendChild(source);
app.appendChild(audio);
button.onclick = function() {
source.src === birds
? source.src = wind
: source.src = birds
}