if (document.execCommand('copy')) {
// 获取要复制的内容
const value = document.getElementsByClassName('hello-div')[0].innerHTML
// 创建input
const input = document.createElement('input')
// 将input的value设置为要复制的内容
input.setAttribute('value', value);
document.body.appendChild(input);
input.select()
document.execCommand('copy')
// 销毁input
input.remove()
}