Tag: <clipboard-copy>
Using bower:
bower install --save advanced-rest-client/clipboard-copy
An element that copies a text to clipboard.
<clipboard-copy content="test"></clipboard-copy>
<script>
const elm = document.querySelectior('clipboard-copy');
if(elm.copy()) {
console.info('Content has been copied to the clipboard');
} else {
console.error('Content copy error. This browser is ancient!');
}
< /script>
- Type:
string
A content to be copied to the clipboard. It must be set before calling thecopy
function.
- Return type:
Boolean
Execute content copy.