JSFiddle - React, Tailwind, and code Playground
HTML
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>MediaElementPlayer.js</title>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="http://mediaelementjs.com/js/mejs-2.13.1/mediaelement-and-player.js"></script>
<link rel="stylesheet" href="http://mediaelementjs.com/js/mejs-2.13.1/mediaelementplayer.css" />
<script type="text/javascript">
function toggle(id){
document.getElementById(id).style.display=
(document.getElementById(id).style.display=='none' ? '' : 'none');
}
</script>
</head>
<body>
<h1>MediaElementPlayer.js</h1>
<h2 onclick="return toggle('test1')">Initially Hidden (Click to toggle)</h2>
<div id='test1' style='display:none'>
<audio controls="controls">
<source src="http://mediaelementjs.com/media/AirReview-Landmarks-02-ChasingCorporate.mp3" type="audio/mp3" />
</audio>
</div>
<h2 onclick="return toggle('test2')">Initially Shown (Click to toggle)</h2>
<div id='test2' style=''>
<audio controls="controls">
<source src="http://mediaelementjs.com/media/AirReview-Landmarks-02-ChasingCorporate.mp3" type="audio/mp3" />
</audio>
</div>
<script>
$('audio').mediaelementplayer();
</script>
</body>
</html>
CSS
#fuu {
width:99px;
height:99px;
display:none;
}
JavaScript
var o = $( '#fuu' );
alert( 'width = ' + o.width() );
alert( 'height = ' + o.height() );