JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html>
<body>
<button onclick="toggleMute()" id="button" type="button">Mute sound</button>
<br>
<video muted id="myVideo" width="320" height="176" controls>
<source src="http://www.w3schools.com/tags/mov_bbb.mp4" type="video/mp4">
<source src="http://www.w3schools.com/tags/mov_bbb.ogg" type="video/ogg">
Your browser does not support HTML5 video.
</video>
<script>
var vid = document.getElementById("myVideo"),
button = document.getElementById("button");
function toggleMute() {
if(vid.muted) {
vid.muted = false;
button.innerHTML = "Unmute sound";
} else {
vid.muted = true;
button.innerHTML = "Mute sound";
}
}
</script>
<p>Video courtesy of <a href="http://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>.</p>
</body>
</html>