x
 
<!DOCTYPE html> 
<html> 
<body> 
<audio id="myAudio" controls>
  <source src="/i/audio/song.mp3" type="audio/mpeg">
  <source src="/i/audio/song.ogg" type="audio/ogg">
  您的浏览器不支持 audio 元素。
</audio><br><br>
<button onclick="enableControls()" type="button">启用控件</button>
<button onclick="disableControls()" type="button">禁用控件</button>
<button onclick="checkControls()" type="button">检查控件状态</button>
<script>
var x = document.getElementById("myAudio");
function enableControls() { 
  x.controls = true;
  x.load();
} 
function disableControls() { 
  x.controls = false;
  x.load();
} 
 
function checkControls() { 
  alert(x.controls);
} 
</script> 
</body> 
</html>