npm install xe-command --save
<script src="https://unpkg.com/xe-command/dist/xe-command.min.js"></script>
document.querySelector('.button').addEventListener('click', evnt => {
if (XECommand.copy('Copy this content to the clipboard')) {
alert('Copy success.')
} else {
alert('The browser is not supported.')
}
})
Copyright (c) 2017-present, Xu Liangzhan