// 旧方法
const btn = document.createElement('div')
btn.id = 'material-btn-id'
btn.className = 'material-btn'
btn.textContent = '素材库'
document.body.appendChild(btn)
btn.addEventListener('click', () => {// 点击事件
})
// 新方法
const btn = document.createElement('div')
const newButtonHtml = '<div id="material-btn-id" class="material-btn">素材库</div>'
btn.insertAdjacentHTML('beforeend', newButtonHtml)
btn.addEventListener('click', () => {// 点击事件
})
insertAdjacentHTML用法详解(点击跳转)