x
 
<!DOCTYPE html>
<html>
<body>
<p>单击按钮创建一个 OBJECT 和一个带有嵌入音频文件的 PARAM 元素。</p>
<button onclick="myFunction()">试一试</button>
<br><br>
<script>
function myFunction() {
  var x = document.createElement("OBJECT");
  x.setAttribute("data", "/i/audio/song.mp3");
  x.setAttribute("id", "myObject");
  document.body.appendChild(x);
  var y = document.createElement("PARAM");
  y.setAttribute("name", "autoplay");
  y.setAttribute("value", "true");
  document.getElementById("myObject").appendChild(y);
}
</script>
</body>
</html>