// 添加var container = document.getElementById(‘divAudio‘);container.appendChild(audio); // 删除var container = document.getElementById(‘divAudio‘); if (container.firstChild !== null) { console.log(‘删除audio元素‘); document.getElementById(‘divAudio‘).removeChild(container.firstChild); }
<div id="divAudio"></div>
原文地址:https://www.cnblogs.com/james641/p/10249780.html
时间: 2024-10-13 13:49:38