var copyNO = document.getElementById("copyNO");

function h5Copy() {
    if (!document.queryCommandSupported('copy')) {
        // 不支持
        alert("不支持复制")
        return;
    }
    var content = copyNO.getAttribute("data-value");
    let textarea = document.createElement("textarea")
    textarea.value = content
    textarea.readOnly = "readOnly"
    document.body.appendChild(textarea)
    textarea.select() // 选择对象
    textarea.setSelectionRange(0, content.length) //核心
    let result = document.execCommand("copy") // 执行浏览器复制命令
    textarea.remove()
    alert('复制【' + content + '】成功');
}

copyNO.onclick = h5Copy;